Urgent Help Needed

Discuss practical ways rearrange URLs using mod_rewrite.

Urgent Help Needed

Postby swc » Thu May 05, 2005 2:53 am

Hi guys, I am looking to change

http://www.domain.com/pictures/member/m ... ?uname=aaa

to something like this

http://www.domain.com/pictures/member/aaa

also let me know what other changes I need to do. Currently, all the pictures uplaoded by the users reside in one single folder only.


thanks,
will be great if i receive help at the earliest.
swc
 
Posts: 6
Joined: Thu May 05, 2005 2:43 am

Postby swc » Thu May 05, 2005 5:48 am

Caterham, I saw you helping many of them. Can you please help me.

Thanks,
swc
 
Posts: 6
Joined: Thu May 05, 2005 2:43 am

Postby seomike » Thu May 05, 2005 5:09 pm

You should read the posts in the beginners section we've gone over this a million times :)

RewriteRule ^/pictures/member/([^/]+)? /memberpanel.php?uname=$1 [L]


Now just make sure you links output the static version .../aaa
seomike
 
Posts: 331
Joined: Thu May 06, 2004 7:36 pm
Location: Dallas

Postby swc » Thu May 05, 2005 9:46 pm

Thanks seomike, but it doesn't work :(
swc
 
Posts: 6
Joined: Thu May 05, 2005 2:43 am

Postby Caterham » Fri May 06, 2005 1:43 am

are you using the rules in httpd.conf or on .htaccess files?

For the last one, use

Code: Select all
RewriteEngine On
RewriteRule ^pictures/member/([^/.]+)/?$ /pictures/member/memberpanel.php?uname=$1 [L]
but remember: mod_rewrite cannot change the link in your surce code.
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby swc » Fri May 06, 2005 1:52 am

thanks caterham, it is the last one ie .htaccess . but I have access to the pictures folder only, no root folder access so will it work if put the .htaccess file directly in the pictures folder or I need to make some more changes to the same.

thanks
swc
 
Posts: 6
Joined: Thu May 05, 2005 2:43 am

Postby Caterham » Fri May 06, 2005 2:01 am

try in /pictures/.htaccess
Code: Select all
RewriteRule ^member/([^/.]+)/?$ /pictures/member/memberpanel.php?uname=$1 [L]

or in /pictures/.htaccess
Code: Select all
RewriteRule ^member/([^/.]+)/?$ /member/memberpanel.php?uname=$1 [L]


or in /pictures/members/.htaccess
Code: Select all
RewriteRule ^([^/.]+)/?$ memberpanel.php?uname=$1 [L]
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby swc » Fri May 06, 2005 2:24 am

Hi Caterham,

Thanks for that help. Well now the link


http://www.domain.com/pictures/member/aaa is working if you try to access it by giving this path directly.

However the problem is that it does't get redirected to this path automatically and I keep seeing the old path only which is
http://www.domain.com/pictures/member/m ... ?uname=aaa

Any idea, why this is happening and how can I solve it.

thanks,
swc
 
Posts: 6
Joined: Thu May 05, 2005 2:43 am

Postby Caterham » Fri May 06, 2005 4:02 am

you'll have to change all links in your script manually to the "static" form
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby swc » Fri May 06, 2005 4:12 am

Thanks, I will change them and see.
swc
 
Posts: 6
Joined: Thu May 05, 2005 2:43 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 38 guests

cron