重写URL将不需要的参数附加到新URL的末尾

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.