Reputation: 8586
I was making a temporary redirect in PHP changing the headers.
However I'd like to make now a simple 301 page redirection directly in Nginx:
http://domain.com/example.php?var=value
to:
I tried:
location / {
index index.htm index.php;
rewrite example.php?var=value / permanent;
}
But it is not working...
Any ideas?
Thanks.
Upvotes: 1
Views: 2270
Reputation: 8586
Simply put (out of "location / {}"):
rewrite /example.php?var=value / permanent;
By the way, PHP has a way to make redirections 301 also.
Upvotes: 4