WordPress Multisite – configuring a local development copy

Yeah, there are a little more steps involved with Multisite. Here’s how I did this for a recent project, after much mucking around:

  1. Set up virtual hosts rather than subfolders on your WAMP box

I’m on XAMPP so this will be a little different for you, but for me I just needed to add the following to c:\xampp\apache\conf\extra\httpd-vhosts.conf:

NameVirtualHost *:80

# Add a default virtual host, which will inherit any settings already made
<VirtualHost *:80>
</VirtualHost>

# Add additional virtual hosts here, changing only the settings you need to
<VirtualHost *:80>
    DocumentRoot "c:/xampp/htdocs/client-site"
    ServerName clientsite.localhost
</VirtualHost>
  1. Make sure the virtual host resolves to your box – use your HOSTS file for this
  2. Install the WordPress MU Domain Mapping plugin (note: apparently this is no longer required as the functionality has apparently been folded in to Core, but there’s very little up-to-date documentation around Multisite and I found I still needed this plugin)
  3. Log in to WordPress Admin and go to Network Admin -> Settings -> Domain Mapping, and:
    • uncheck Remote Login
    • check Permanent Redirect
    • check User Domain Mapping Page
    • uncheck Redirect Administration Pages
    • check Disable Primary Domain Check
  4. Go to Network Admin -> Settings -> Domains, and add your local domain with a random site ID. Uncheck the Primary checkbox, and save.
  5. Manually edit the new database record that was just created in the wp_domain_mapping table, and set the site ID back to the ID of the site you are using (probably ID 1 if it’s the main site) – this is because aliases on the primary domain are supported, but WordPress won’t let you add them through the interface

Start developing locally!

I may have missed a step that I didn’t document when I was setting this up, so please do let me know if this works and/or if you needed to do anything else.

error code: 523