Question

Domain automatically redirecting to droplet IP - one-click Wordpress installation

I’m using the one-click Wordpress installation which is run on Ubuntu 16.04. I had my domain set up prior to installing WP on my droplet, and when I try to access my domain it redirects to my droplet IP’s address with the WP installation.

Tried changing the Site Address (URL) to the site - it did nothing. Then I also changed the Wordpress Address (URL) and I couldn’t access Wordpress anymore. It kept redirecting to the domain and my browser said it couldn’t find the DNS address so I was stuck on an error page. Tried rebuilding and I faced the same problem. (yes, I did try clearing my browser’s cache too)

How can I fix this? I want my WP installation so that all pages are on my domain. I don’t want it to redirect to the IP. I already changed nameservers and set up an A record at @.

Thanks!

Subscribe
Share

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

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.

Accepted Answer

@cosmopath

Did you set the domain configuration within ./wp-admin or inside of ./wp-config.php? When you’re changing the URI, it’s best to set this in ./wp-config.php using constants since the second you do it within the control panel, the settings take whether they’re right or wrong.

The benefit here is that ./wp-config.php is loaded on each page load, since it’ll load before the rest does, it ensures that the URI’s are correct.

Open up ./wp-config.php and below the line define( 'WP_DEBUG', false );, add:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Change http://example.com to your domain, save ./wp-config.php, reload your page.