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?
rewrite ^/conteudo.asp$ /? permanent;
(i.e. without the location block) - seems to work fine for me (even without the start/end delimiters, and without the question mark)rewrite ^ /? permanent;
works fine. Did you clear browser cache or try with another web browser?