I'd like to make two simple 301 page redirections.

For example:

http://domain.com/example.php?var=value

and:

http://domain.com/some-page

Both redirecting to:

http://domain.com/index.htm

Which is the index of the domain.

I tried:

location / {
    index index.htm index.php;
    rewrite example.php?var=value / permanent;
}

But it is not working...

Any ideas?

Thanks.

link|improve this question

59% accept rate
feedback

1 Answer

Simply put (out of "location / {}"):

rewrite /example.php?var=value / permanent;

Or better:

rewrite /example.php?(.*) / permanent;

By the way, PHP has a way to make redirections 301 also.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.