rachelk Posted August 2, 2009 Share Posted August 2, 2009 I wanted the url http://mywebsite.com/folder-here/?cat=first&id=(up to 3-digit number here) to redirect to http://mywebsite.com/?id=(up to 3-digit number here) I tried this but it's not working.. any help is much appreciated! RewriteRule ^http://mywebsite.com/folder-here/?cat=first&id=([0-9]+)$ http://mywebsite.com/?id=$1 [R=301,L] Link to comment https://forums.phpfreaks.com/topic/168467-solved-simple-url-redirect-help/ Share on other sites More sharing options...
rachelk Posted August 2, 2009 Author Share Posted August 2, 2009 This works: RewriteCond %{QUERY_STRING} &?cat=first&id=([0-9]+)&? RewriteRule ^folder-here/ http://mywebsite.com/?id=%1 [R=301,L] but it's messing with other scripts on other parts of my site which use the same query structure, I only want it applied to urls with "http://mywebsite.com/folder-here/".. I don't understand why it's not doing that, I've been at this for hours! Link to comment https://forums.phpfreaks.com/topic/168467-solved-simple-url-redirect-help/#findComment-888674 Share on other sites More sharing options...
rachelk Posted August 2, 2009 Author Share Posted August 2, 2009 Turns out it was something else in my htaccess that was messing it up, the second one works fine. Link to comment https://forums.phpfreaks.com/topic/168467-solved-simple-url-redirect-help/#findComment-888764 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.