Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

For example:


Both redirecting to:

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?


share|improve this question

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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