I’ve got to redirect a URL that has a question mark in it, and I just can’t figure out the proper .htaccess code to make it happen.
Example:
redirect 301 /home.php?cat=16 http://www.example.com/furniture.html
I believe I need to do a rewrite condition, but I’m no htaccess expert.
With the
Redirectdirective from mod_alias you can only examine the URI path and not the query (applies to all directives of mod_alias). If you want to examine the URI query you need to use mod_rewrite:The empty query in the replacement will prevent that the original query is being appended to the new URI.