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]

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.