Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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.