Domain Mapping with WordPress Multisite, DreamHost and GoDaddy

After attending WordCamp Minneapolis I was encouraged and pushed in a session led by Ryan Imel of wpcandy.com to go ahead and dive into WordPress Multisite. I’ve messed around before with WordPress mu but never went very far.

Now for those of you who are not coming to this post from a Google search WordPress Multisite is a feature built into WordPress that will let you manage an entire network of WordPress installations from on Super Duper Network Admin. The main benefits are that you can control all of your site easier, upgrades are a cinch and its much less hassle to manage security on a network of sites than on 20 individual sites.

With that knowledge I decided to start to pull all of the clients that I currently manage into one location.

This post will not explain how to set up a WordPress Multisite network but rather it will describe my experience in mapping domains to the network. If you want to know how to set up a multisite installation go check out this tutorial at wpcandy.com first, then come back and see how you can map your domains.

The only important issue and this is critical, if you are using DreamHost in a shared environment your network must be set up to use the sub-directory option for new sites and not sub-domains.

I will be using specific examples with my host and domain registrar. If you use a different host and or registrar the screens and processes will be slightly different but hopefully you’ll have a good idea of what to look for.

Step 1 – Install the Domain Mapping Plugin

So once you have your network set up you need to download and install the Domain Mapping Plugin. This is not a normal plugin so don’t install it like you would a normal plugin. You need to manually move two files.

The first file is the domain_mapping.php file. This needs to go into the mu-plugins folder. The mu-plugins folder is a special folder, which you may not even have yet. Just create it underneath the wp-content folder and put that file into it.

The second file is the sunrise.php file. This is a special filename for WordPress. Don’t worry about the wacky name, just put it in the wp-content folder and make a mental note that it is not a spam file when you’re checking your site a few months from now.

Activate the sunrise.php file
Add this line of code to your wp-config.php file above the line where it says to stop editing.

define( 'SUNRISE', 'on' );

My file file looks like this at the bottom:

define( 'SUNRISE', 'on' );
/* Stop editing */

$server = DB_HOST;
$loginsql = DB_USER;
$passsql = DB_PASSWORD;
$base = DB_NAME;

define('ABSPATH', dirname(__FILE__).'/');

// Get everything else
require_once(ABSPATH.'wp-settings.php');
?>

Step Three – Get a Unique IP from Dreamhost

I am running my multisite network on a shared server with Dreamhost. They do not recommend that you do this but if you are not managing many sites a shared server should work fine. In your Dreamhost admin panel menu:

  1. Click manage domains
  2. Find the domain that you’ve installed your network under
  3. Click the link ‘Add IP’ under the domain
  4. Decide how you want to pay, monthly or yearly and then click the button to confirm and add the ip to the domain

You should now have a unique IP address listed under your domain name. It will look something like this – 64.230.812.34. Copy this numbered address.

Step Four – Configure the Domain Mapping Plugin

In your Super Admin or Network Admin if you’re running WP 3.1 find the ‘domain mapping’ menu item and choose it. Paste the IP address you copied earlier from your DreamHost panel into the box asking you for your server IP address.

The other options you see here are as follows:

  • Remote Login – This will make your login pages for all sites redirect to your main site to do the actual login. The benefit of this is that when you log in to one, you log into all of them. The downside is that the URL changes to another domain in order to log in.
  • Permanent redirect (better for your blogger’s pagerank) – This makes your subdomain or subdirectory sites redirect to their domains. You should leave this on.
  • User domain mapping page – Turn this on if you want users to be able to put in their own domains for mapping.
  • Redirect administration pages to blog’s original domain (remote login disabled if redirect disabled) – This makes all admin pages show up on the original domain instead of on the new domains. You need this enabled for remote login to work.

I use numbers 2 and 3 but you can choose for yourself.

Step Five – Parking Your Domain and Editing the DNS

At this point we’ll transition over to GoDaddy to edit the settings for the domain you want to map. This is not the domain that your network is installed under but rather the domain of an individual site that is part of your network.

  1. Log into your GoDaddy account
  2. Navigate to your domain manager screen
  3. Click on the domain you want to map
  4. The domain either needs to be parked or use GoDaddy’s default namesevers. You can not have custom nameservers, so if you need to click on “set namesevers” link and park your domain do it now
  5. Once your domain is parked or if you are using GoDaddy’s default nameservers you can launch their new DNS manager. Click the ‘launch’ link in the DNS manager section
  6. You are going to modify the A record. This should be the first record listed. Click on the editable area in the ‘points to’ column and paste the unique IP that you purchased from DreamHost for the main domain your network is installed under.
  7. Click the big black ‘Save Zone File’ button in the upper right corner of the screen.
  8. Log out of GoDaddy
  9. Step Six – Mapping the Domain in WordPress

    The easiest way for this final step is to login to the backend of the site you are mapping and click the ‘domain mapping’ option in the tools menu. Once you’ve done that just enter in the full domain that you just edited the dns for, check the box ‘primary domain for this blog’, and click the ‘add’ button.

    As soon as you do this the changes will take effect and if the DNS has propagated you’ll be able to access your networked site with its own domain.

Comments

  1. Amit says:

    I managed that on dreamhost without buying a unique IP, just go to your domain dns settings and get the A record IP, use that for the server’s IP address.

    • Josh Byers says:

      That could work but you’ll need to periodically check to make sure the ip hasn’t changed. Or you’ll know it when all your sites go down! :)

  2. Kyle says:

    Great tutorial. Best help I’ve found with Dreamhost.

    Like @Amit, I used the A record IP, but I am running into a problem.

    Because Dreamhost doesn’t allow Wildcards, I have my main site (network enabled at course) created sub-directory sites and then I’m using domain mapping to push some of those sites into sub-domains.

    http://kyleandliz.info/maintest
    http://maintest.kyleandliz.info/

    Following as many tutorials as possible on domain mapping with dreamhost using mirrored domains, I’ve setup everything correctly, but I’m getting this message from Safari when I visit the site:

    can’t open the page “http://maintest.kyleandliz.info/” because Safari can’t find the server “maintest.kyleandliz.info”.

    The only thing I can tell is that it is leaving off the “http://” and the ending “/”.

    Any ideas why it is failing?

    Thanks,
    ~Kyle~

    • Josh Byers says:

      No I don’t. But I would try and get in contact with the authors of the domain mapping plugin – I know from personal experience that they are very helpful and could probably figure out what is going on pretty quickly.

Trackbacks

  1. [...] Domain Mapping with WordPress Multisite, DreamHost and GoDaddy. [...]

  2. [...] • 1:33pmIt's self-hosted. There's actually a second part to this as described here http://redlettersstudio.com/blog…Needed to turn on multisite and get a unique IP and use that plugin.Aen Tan • 8:56pmView All 3 [...]

  3. [...] using the Word­Press MU Domain Map­ping plu­gin to map Word­Press to another domain. I used the this tuto­r­ial. I had to pay a monthly fee for a unique IP address because it wouldn’t work oth­er­wise. I [...]

  4. [...] using the Word­Press MU Domain Map­ping plu­gin to map Word­Press to another domain. I used the this tuto­r­ial. I had to pay a monthly fee for a unique IP address because it wouldn’t work oth­er­wise. I [...]

  5. [...] Domain Mapping with WordPress Multisite, DreamHost and GoDaddy [...]

Speak Your Mind

*