Wordpress not working with domain name, redirect too many times
I registered a domain name with google’s registrar and I have it pointed to digital oceans name servers. This works fine, everything pings correctly.
I am trying to setup a wordpress site and the initial setup works. I can connect with the ip address or the domain name AND it will show the domain name in the address bar. Note that at this point the wordpress settings show the site and wordpress URL as the ip address. Despite this, the domain name still shows in the address bar, which is what I want.
If I make any theme change to the wordpress site, even if I switch out of and back into the initial theme (where everything was working), the address bar will no longer show the domain name. I can use the domain name to get to the website, but the URL will show the IP address, which I don’t want.
If I update the URL’s in the wordpress admin settings to be the domain name AND update the apache2 config to have servername and alias set to the domain name, then the website will not load. I get an “redirected you too many times” error. Note that the admin page: www.domainname.com/wp-admin works fine, www.domainname.com gives me the redirect issue.
I can switch back the wordpress settings URL’s to the ip address and the site works again, but it shows the ip address in the URL bar.
How can I solve this redirect issue and get the site to work with the domain name showing in the URL bar? Thanks!
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.