Stop redirecting one domain to another

I have a personal personal website to which I have two domains directed to. One of them is the old domain, the other one is the new, proper domain. This is a django website, which I run with Nginx and UWSGI.

I’m in the process of creating another website, and I want to use that old domain to test it. This shall be a wordpress website.

I removed all the rewrite/redirect parameters from Nginx, and also removed the old domain from the server_name parameter of the Django website, and sudo service nginx restarted and restarted UWSGI. I also stopped the A and CNAME records from pointing to the other website (and more than four days have passed since I did it) and updated them to point to themselves. I have two other websites up so I know I didn’t mess up at this part.

So I figure that either I have messed up some config file (although I couldn’t find anything substantial with grep -r) or for some reason Digital Ocean didn’t update the records.

I’ve updated the files in:

/etc/nginx/sites-available/ (which are linked to the ../sites-enabled/ folder. /etc/uwsgi/sites/ (which is where the the uwsgi init script points to) /home/user/Websites/djangoapp/djangoapp/ (updated the “ALLOWED_HOSTS” to no longer allow the old domains)

And they no longer make any mention to the old domain, but this domain keeps redirecting to the new domain. Is there anything I forgot?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


I have seen browsers cache redirects, most specifically Chrome. If you pull up a web browser that you’ve never used to visit that domain, does the redirect still occur?

Break out the old Internet Explorer if you need to for a test, and/or a curl test via command line to see what code is returned when checking the URL (curl -I domainname).