Well, I am lost... I was trying to transfer my WordPress server (on Ubuntu 18.04) from Azure to AWS. I used ManageWP to do this, but had issues with logging in. So I created a new blank WordPress server that I named dev.mydomain.com. and successfully cloned the server.
I then wanted to remove the "dev." entry in DNS and just use my "www." name. There are three A records in my DNS zone that point to my server: "www", "*" and "@".
But regardless of which browser I use or browser cache I flush I keep getting redirected to "dev.mydomain.com". I am pretty certain that this is a server or DNS issue. I have gone to the extent of deleting the WordPress content and creating a static html file for the server. It's just a standard .htaccess file for WordPress with no obvious redirects in it, and I deleted it for the static page.
Even when I point my DNS back to the Azure servers the "dev." keeps coming back. To make the site work I need to put a "dev" serveralias in the Apache Virtual Hosts table. My DNS is hosted through GoDaddy and I have searched everywhere for a phantom A or CName entry for "dev."
I hope there is someone that can enlighten me?
1 Answer
There's no mechanism in DNS for rewriting host names, so it is certainly not a DNS issue. There can be two culprits here, really:
- Web server is somehow configured to redirect you
- The web server was configured to redirect you, and your browser now caches this.
To verify this, first check that the DNS records are seen correctly. DNS can take some time to propagate. This can be verified with
dig +short example.orgIn the case of verifying cname, do
dig +short example.org cnameOnce you have verified that DNS is correctly confiured, use curl to check for any offending headers from the webserver.
curl -I Look for any lines starting with Location: which is redirects.
This will tell you about server configuration. Note that curl uses no caching, so it is always fresh information after configuration changes.
This is not a complete answer, but I believe it is the best possible given the information. If you update your question with more information I will expand the answer :)