Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

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

 
discard

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.