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

I'm using nginx to rewrite a url

rewrite ^/old$ /new1 permanent;

I need to change the address that /old redirects to (/new1) every few days. I noticed that when I change the /new1 url to /new2 and restart nginx, browser still redirects to /new1 untill I clear browser cache.

How can I prevent browser from cacheing redirection url?

P.S. The reason I need to keep changing the url is that I have a banner set up on one of the sites and in order to not bother the site owner with new url all the time, I though I'd give him one address to use and keep changing my redirection myself.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

You should not use permanent redirections. The code should be:

rewrite ^/old$ /new1 redirect;
share|improve this answer
    
That worked. Thank you. –  user80666 Jun 25 '12 at 17:28

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.