By cosmopath
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!
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!
Accepted Answer
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.