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??
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??
RewriteRule ^contact/index.php?id=(.*) http://www.website.com/att/att_profile.php?member=$1 [r=301,nc]
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]
RewriteCond %{QUERY_STRING} id=([^&;]*)
RewriteRule ^contact/index.php$ http://www.website.com/att/att_profile.php?member=%1 [R=301,L]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
http://www.website.com/contact/index.php?id=5
to
http://www.website.com/att/att_profile.php?member=5