htaccess; /search/?q=test to /test

Posted by Matthew Haworth on Stack Overflow See other posts from Stack Overflow or by Matthew Haworth
Published on 2010-03-27T13:22:40Z Indexed on 2010/03/27 14:23 UTC
Read the original article Hit count: 205

Filed under:

I have a similar situation to the one described in the title.

All that I need to do is map all requests in the form /search/?q=test to /test. This is because we are changing the way our search works to make it user friendly, but still want to allow for backward compatability (i.e. anyone that may have these links bookmarked etc).

However, thus far I have this:

RedirectMatch 301 /search/?q=(.*) /$1

And that doesn't work, but:

RedirectMatch 301 /search/(.*) /$1

does...

Any idea why?

Cheers.

© Stack Overflow or respective owner

Related posts about .htaccess