I would like to redirect without looking at the query string, and my redirect result no need append the query string as well, so I add a ? at the end of the RewriteRule.
I tried the following syntax, but the outcome just close to it.
RewriteCond %{QUERY_STRING} .* [NC]
RewriteRule ^exd\.asp$ http://www.example.com/index.php?r=p/consumer? [R=301,L]
and also, i tried to escape the first ?, which I need it, but still the same outcome.
RewriteRule ^exd\.asp$ http://www.example.com/index.php\?r=p/consumer? [R=301,L]
Outcome:
http://www.example.com/index.php?r=p/consumer%3f
I want to get ride of the %3f.
Thanks!
You don’t need to append a
?at the end if you already have a query string in your target. Just do this:By default, query strings get appended, like this:
You request
/foo?blahand you get/bar?blahHowever, if you have a
?in your target, query strings won’t get appended unless you have theQSA, so:You request
/foo1?blahand you get/bar, you request/foo2?blahand you get/bar?q=2. If you include aQSAin the rewrite flags, then&blahgets appended to the end.