In this tutorial, I will walk you through the installation of WordPress Multisite and explain how to configure it so that you can run multiple domains from the same WordPress installation.
Why Use WordPress MultiSite?
Managing multiple sites from the same WordPress installation has a lot of nice advantages.
One of the basic advantages is that you won’t have to install the same plugins over and over again as you start new sites (this is especially helpful if you’re using plugins like Akismet or Gravity Forms where you always have to hunt for your license/API keys). Now, you can just network enable your plugins and use them on any site you want to. You also won’t have to upgrade multiple WordPress installations whenever a new version is released — a single click of the button will get all your sites completely up to date. And adding a new domain takes only a minute.
There are many advanced possibilities as well. If you’re a developer, you’re probably familiar with the pains of maintaining multiple code bases, or upgrading multiple instances of the same theme thanks to the hell that is cross-site PHP scripting. Well, you can kiss those pains goodbye now. We’ll be setting up virtual sites here, so you’ll be able to access the same files/themes/plugins/whatever you want from any site on your WordPress installation — this is powerful stuff.
Please Note
This is a relatively advanced tutorial as far as most WordPress tutorials go. You don’t have to do any programming, but you will have to make some edits to files that will completely crash your site if you make a mistake. A basic understanding of htaccess and php is recommended.
Requirements
- Your existing WordPress installation *must* be in the root of your site (not a subdirectory like /blog ).
- You must have access to a control panel like cPanel or Plesk.
- Your host must allow the creation of subdomains.
Before You Begin
At this point, it’s a good idea to go ahead and set your DNS settings on the sub-sites that you want to work with (ie: you want to add mysite2.com to the mysite1.com installation). This should ensure that the DNS propagation will be complete by the time you complete this tutorial.
The nameservers on your ‘secondary’ sites should match those of the root domain (mysite1.com) that we’ll be working with here.
Installing WordPress Multisite
One of the nice things about post 3.0 WordPress is that MultiSite is prepackaged, just waiting for you to enable it — much like a War of the Worlds invasion.
To enable WordPress Multisite, open your wp-config.php file and add the following line directly above where it says /*That’s all, stop editing! Happy blogging */
[php]define(‘WP_ALLOW_MULTISITE’, true);[/php]
There are two primary options that you need to be aware of when configuring MultiSite:
- Your sites can be in subfolders ( /blog/) or
- Subdomains ( blog.yoursite.com )
If you want to run multiple domains on the same installation, you’ll need to use subdomains. To ensure that all new sites you create are setup as subdomains, add this line to wp-config.php as well, directly below the command above.
[php]define( ‘SUBDOMAIN_INSTALL’, true );[/php]
Create a New Directory
Before you can enable your network of sites, you will need to create a directory named blogs.dir inside your /wp-content/ directory. This is the directory that will be home to all of your uploaded media files (images, etc). Make sure that the blogs.dir directory has the same permissions as your /wp-content/ directory (most likely 755).

Enable Your Network
Now that you’ve created the blogs.dir directory, you need to enable your network of sites in WordPress. To do so, login to WordPress and click the Network Setup link on the left hand nav:

Note: You will have to temporarily deactivate your plugins to successfully enable the network. Don’t worry, it will only take a minute.
Once you’ve deactivated your plugins, enter your Network Title and email address into the form and click the Install button.

You will now be presented with either two or three text boxes filled with code (depending on your original wp-config setup). These are simple copy+paste jobs.
Follow the instructions preceding each text box — you will be editing your wp-config.php and .htaccess files. Be very careful, and make a backup of each file before editing: making a mistake in either of these files will completely crash your site.
When you finish making the changes and verify that your site is still running, you will need to logout and back into WordPress.
When you log back in, you’ll need to make sure that you’re in the Network Admin and not Site Admin. To switch to Network Admin, mouse over your username at the top right of your WordPress admin UI, and you’ll see something like this:

Select Network Admin from the list, and then go ahead and reactivate your plugins (Network Enable any plugins that you want to use on multiple sites).
Enable Wildcard Subdomains
Before you can create new subdomain sites that actually work, you’ll need to enable wildcard subdomains. If you’re using cPanel, you can enable your subdomains by navigating to your site’s control panel (click List Accounts on the left nav, and then the cPanel icon next to the site you want to add the subdomain to) and adding a new subdomain. To add a wildcard subdomain, put a * in the subdomain field as pictured below.
Also, make sure that you set the value of the Document Root field to the root level of your WordPress install (which should be the root of your site).

If you’re using Plesk, follow these instructions.
Install WordPress MU Domain Mapping Plugin
The WordPress MU Domain Mapping plugin will handle all of the redirects needed to turn your subdomains into real domains of their own. Either download it here or install through your WordPress UI.
Once it’s installed, you will need to make some manual adjustments.
1. In your FTP client, navigate to the WordPress MU Domain Mapping directory. Download sunrise.php to your desktop, and re-upload into /wp-content/. If you already have a sunrise.php file (you probably won’t), you will need to merge the two.
2. Edit wp-config.php and add this line above the last “require_once” command:
define( ‘SUNRISE’, ‘on’ );
Set WordPress MU Domain Mapping Options
In WordPress (still in Network Admin), go to Settings->Domain Mapping.

On the following screen, you will presented with the options below. I have found that the following settings work well for my needs:

Adding a New Domain To Your Network
In WordPress, go to Sites->Add New
Enter the subdomain for this site, your site’s title, and your email address. Here’s how I set mine up:

When finished, click the Add Site button.
Now go to Sites->All Sites. Mouse over the new subdomain you just created, and watch the tooltip at the bottom of your browser to see the destination URL. You’ll see a URL parameter called ‘id.’ This parameter stores that site’s unique numerical ID. Write it down — you’ll need it in a second.
Now we’re ready to configure the domain mapping in the WordPress MU Domain Mapping Plugin.
Configure Domain Mapping
In WordPress, click ‘Domains’ from the Settings section of the left nav. When the page loads, focus your attention on the ‘New Domain’ section of the page. Here, there are two fields. One is the site’s ID (the unique number you wrote down a second ago) and the domain. Basically, you are telling the plugin that the subdomain behind Site ID x should resolve to the domain you’re putting in the Domain box.
Here are my settings:

Once you have things the way you want them, click the Save button.
Park Your Domain
This is the last step (woot). Here, we’re going to park your secondary domain (mynewsite.com) on top of your primary domain (in my case, makeitrank.com).
If you’re using cPanel, navigate to DNS Functions -> Park a Domain.

Here, we’re parking the new domain on top of the ‘root’ domain we’re already running WordPress on.

(I scratched out my username in the screenshot above because…well…it wouldn’t be secure to show you that, would it?)
Click the ‘Submit’ button, and check on your site. Your new domain should be running perfectly.
In Closing
From here on out, when you want to create a new site all you have to do is:
- Add a new site within WordPress
- Set the DNS on your new site to match the settings on the ‘root’ site
- Configure the site in the Domain Mapping plugin
- Park the new domain on top of the ‘root’ domain
I hope you found this useful. If you have any questions/comments, leave them in the comments below.



by:
Protect your content from scrapers, aggregators, and other scary creatures
Your masked affiliate links aren’t fooling Google
How to disable the RSS feed on a WordPress site
The search results page of the future?
Dear Google: It’s not all about you
Hey, thanks for the tutorial! I’m in the first steps now. My first concern is for the “root directory” requirement: I have my WordPress installation in the “public_html” folder (using BlueHost), which I believe would be considered to be the root directory in this case. I will let you know if this does not work, but things look good so far. Thank you for the time you put into this tutorial!
Thanks!
Your public HTML directory is most likely your root directory. A quick way to check is to upload a file to it. Is the path yoursite.com/uploaded-file? If so, your site is in the root.
I seem to have stumbled on the first step, “Installing WordPress Multisite”. When I added those two lines of code, my website began to display a “No site defined on this host” error. I will look around for a solution and re-post if I find one.
It sounds like you’re working with a new installation of WordPress here, rather than editing an existing installation?
I should have made that clear in the tutorial — I’m assuming that you already have a site up and running. If you don’t, go through the normal installation process before editing wp-config.php
Well, I was actually using an existing installation with my main site, longworthdental.com, but my other sites were new enough that I could afford to lose them if anything went wrong. I’m terrible for not backing stuff up, and I realized just how important it is as I went through your tutorial. Luckily, the support people in WordPress.org forums were able to help me out. I think I’ve broken the network in 5 different ways so far!
That said, everything is almost set up the way I want it, and the hours I put in now will get paid back many times over in the years to come. Thanks again for all your help!
In order to get this to work with GoDaddy Economy Hosting you will need to set up a sub-domain that points to the root directory (mysite2.mysite1.com) as well as add the new site domain to the hosting plan as a secondary domain (mysite2.com) and point it to the root directory as well. With the Economy plan you can not create Wildcard subdomains so this is a work around. You might be able to add the Wildcard directly to the DNS Zone, however I couldn’t get it to work, I had to do as I described. Also, to get the full “www” in your url, when adding configuring the domain mapping, simply put http://www.mysite2.com rather than mysite2.com. I scratched my head on that one for a little while. Good luck, hope this helps someone. Thanks Kevin for a great post. I now have my site and my wife’s site running on one WordPress installation. (I’m still meddling with mine, so don’t judge me
)
Awesome — thanks for adding that, Todd.
Also forgot to mention – if wanting the www in the URL as i described above, you will need to add this just after the “RewriteEngine On” in your .htaccess file:
RewriteCond %{HTTP_HOST} ^mysite2.com$ [NC]
RewriteRule ^(.*)$ http://www.mysite2.com/$1 [R=301,L]
If you don’t, mysite2.com will not work and you’ll most likely hit a redirect loop.
Hope this helps someone.
Brilliant tutorial. I remember doing this for an SEO firm I used to work with and it created a huge asset for the company once we plugged in 100′s of PR2-PR5 sites.
Also a great way to begin building an empire of sorts too (links, citations, etc..)!