Report this

What is the reason for this report?

Cloning Wordpress: Domain Appearing Twice in Links?

Posted on March 4, 2016

Hello,

I’ve cloned my wordpress site by creating another droplet. I want to run it as a test site.

At the moment, all the links to stylesheets etc point to: IP-Address/the-revelant-file/IP-Address/the-relevant-file

So as you can see the link is essentially duplicating for all the links to files.

Any way to stop this? 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!

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.

Hey there,

Your best bet is to manually override the WordPress name by editing the wp-config.php file and placing these lines just above the database connection details:

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

You can either point a ‘stage.yourdomain.com’ to your cloned Droplet, or use the IP address in it’s place http://111.222.333.444.

Note: You’ll want to make sure any changes you make are not hardcoded to your development IP or domain if you plan on copying your WordPress installation back to the live server. Make sure that any theme edits or posts/pages do not reference full paths with the IP or domain name. For example, instead of http://111.222.333.444/wp-content/uploads/test.jpg, you would want to use /wp-content/uploads/test.jpg.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.