I've implemented this rewrite rule:
RewriteCond %{QUERY_STRING} ^pBrand=GRAVIS$ [NC]
RewriteRule ^brand\.php$ /brand/gravis/ [R=301,L]
The redirect works fine however, the end result is:
http://site.com.au/brand/gravis/?pBrand=GRAVIS
The problem is that, I don't want to have the ?pBrand=GRAVIS
appended. How do I get rid of it?
YOu need a ?
to remove the query string:
RewriteCond %{QUERY_STRING} ^pBrand=GRAVIS$ [NC]
RewriteRule ^brand\.php$ /brand/gravis/? [R=301,L]
Normally, the query string gets appended automatically, but if you have a ?
in the target, the query string doesn't get appended unless you have the QSA
flag.