Stop redirecting one domain to another

Posted April 3, 2019 3.7k views
NginxWordPressDjangoUbuntu 16.04

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/ 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?

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.

Submit an Answer
1 answer


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).