I'd like to make a 301 rewrite to the sites's index without any querystring. Like this:
http://example.com/anypage.asp?anyvar=anyvalue
To:
http://example.com/
Here's a real example:
http://atipico.com.br/conteudo.asp?P_categ=23
I am trying to follow this: http://wiki.nginx.org/NginxHttpRewriteModule#rewrite
(The commented are my attempts):
location ~ /conteudo\.asp(.*)$ {
#rewrite ^ / permanent;
#rewrite ^ /? permanent;
#return 301 /;
#return 301 /?;
#if ($args) { return 301 /; }
}
It always rewrites to http://atipico.com.br/?P_categ=23
Any ideas?
This is the best rule I found and it is working to me:
Meaning, rewrite all requests:
starting in the root of the domain (^/)
than followed by "content"
to the root (index) of the site (/)
removing all query strings it might have (?)
and show a 301 redirect in the headers.
I guess that's it.