Link to home
Start Free TrialLog in
Avatar of cimmer
cimmer

asked on

mod_rewrite rule rewriting querystring to new querystring.

currently i have th following line in my .htaccess file and it works fine.
RewriteRule ^contact/index.php(.*) http://www.website.com/att/att_profile.php$1 [r=301,nc]

it correctly redirects
http://www.website.com/contact/index.php?id=5
to
http://www.website.com/att/att_profile.php?id=5


what I really want it to do is redirect
http://www.website.com/contact/index.php?id=5
to
http://www.website.com/att/att_profile.php?member=5

how do i do this??
Avatar of cimmer
cimmer

ASKER

Avatar of ramazanyich
RewriteRule ^contact/index.php?id=(.*) http://www.website.com/att/att_profile.php?member=$1 [r=301,nc]
Avatar of cimmer

ASKER

i fixed it myself... this works

RewriteCond %{QUERY_STRING} id=([^&;]*)
RewriteRule ^contact/index.php$  http://www.website.com/att/att_profile.php?member=%1 [R=301,L]
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial