Reputation: 45
I have something like this:
RewriteCond %{QUERY_STRING} ^something=true$
RewriteRule ^$ http://www.a123dress.com/ [R=301,L]
I want redirect ALL (*) request which have "?something=true" to
It works for:
I want rewrite for example:
http://www.a123dress.com/test/?something=true
to:
http://www.a123dress.com/test/
so cut off ?something=true like above in first example
Upvotes: 2
Views: 33
Reputation: 785581
Your regex ^$
is just allowing home page /
to be redirected. Change your rule to:
RewriteCond %{QUERY_STRING} ^something=true$ [NC]
RewriteRule ^ %{REQUEST_URI}? [R=301,L,NE]
Upvotes: 1