Cloning Wordpress: Domain Appearing Twice in Links?

March 4, 2016 743 views
WordPress

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.

1 Answer

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.

  • I came here because I have the same issue. The only catch is that I had already hard coded the WPHOME and WPSITEURL in wp-config.php from the start.

    Any idea what else might be causing this?

Have another answer? Share your knowledge.