Reputation: 39
I've trying to redirect (with .htaccess file) this: http://www.example.com/?deletethis to: http://example.com
I try this: RewriteEngine On
RewriteCond %{QUERY_STRING} deletethis [NC]
RewriteRule . http://example.com/? [R=301,L]
But doesn't work, I try this: RewriteEngine On
Redirect 301 /?deletethis http://example.com
But doesn't work either.
Upvotes: 0
Views: 26
Reputation: 10132
Try this:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} deletethis [NC]
RewriteRule ^ http://example.com/? [R=301,L]
Replace .
with ^
Upvotes: 1