I want to share WordPress sites in development across a local network. What is the easiest way?

I’ve just got a new PC, running Win7/64. My current projects are all on my Macbook. Of course I could just move the projects over but I like the portability so my ideal scenario is my work syncing across the computers. This is simple with most types of files using LAN file sharing, but when it comes to my WordPress sites I hit some problems. Here’s what I’ve tried so far:

  1. Sharing my htdocs folder and then accessing it in the browser through http://my.ip.address:portnumber/directory. This works except a crucial problem – <?php bloginfo('template_url); ?> thinks the site’s root is localhost instead of my.ip.address, which breaks all my root links like stylesheets.

    Read More
  2. Creating a shortcut to my Macbook’s shared MAMP/htdocs folder inside my PC’s XAMPP/htdocs folder. Not actually sure if it’s possible to access shortcut files at all through the browser, I tried a few different combinations of /s that didn’t work. This was a longshot anyway really.

I understand I need to somehow get the PHP generated after it arrives to my computer, but I really don’t know how I’d go about making that happen.

Any help much appreciated.

Related posts

Leave a Reply

1 comment

  1. Add the following to your wp-config.php file, and it will fix your issue in #1

    define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
    define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);