rachelk Posted August 12, 2009 Share Posted August 12, 2009 I usually just try a bunch of things until something works with mod rewrite, but I'm getting nowhere here! I wanted to redirect http://mysite.com/folder/?id=name to http://mysite.com/folder/?cat=name my failed attempt: RewriteRule \?id=$ http://mysite.com/folder/\?cat=$1 [L,R=301] Quote Link to comment https://forums.phpfreaks.com/topic/169873-solved-redirecting-one-dynamic-url-to-the-other/ Share on other sites More sharing options...
corbin Posted August 12, 2009 Share Posted August 12, 2009 RewriteRule does not take the query string into account.... You'll have to do something like: RewriteCond %{QUERY_STRING} id=([^&]+) RewriteRule (.*) $1?cat=%1 Quote Link to comment https://forums.phpfreaks.com/topic/169873-solved-redirecting-one-dynamic-url-to-the-other/#findComment-896263 Share on other sites More sharing options...
rachelk Posted August 13, 2009 Author Share Posted August 13, 2009 Thank you so much! Quote Link to comment https://forums.phpfreaks.com/topic/169873-solved-redirecting-one-dynamic-url-to-the-other/#findComment-897019 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.