Jump to content

[SOLVED] Simple(?) url redirect help


rachelk

Recommended Posts

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

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.