domain-mapping-wordpressIn my previous post Setting Up WordPress Multisite is Not That Hard. A How-To Guide, I have shown you how to set up WordPress multisites to  create a network of sites structured, either as sub-domains or sub-directories of a main site.

However, if neither sub-domains nor sub-directories work for you because you need a different domain for each WordPress site, you need to go a step further in order to take advantage of the Multisite ability of WordPress. This is called Domain Mapping or DNS mapping and it is something that requires a little extra work,  but if this is what you need,  it is worth it.  So, let’s go!

Install WordPress, enable the Multisite feature, and setup a network using either sub-domains or sub-folders.  If you don’t know how to set up WordPress multisite , please, check out this post  Setting Up WordPress Multisite is Not That Hard. A How-To Guide.

At this point, your WordPress is already setup to handle multiple sites, but you need to install a plugin, called WordPress MU Domain Mapping,  in order to allow the sites of your network to have different domains.

domian mapping wpWell, it is true that WordPress MU Domain Mapping makes things a lot easier, but it is  a little tricky. WordPress MU Domain Mapping is not the kind of plugin we are used to.

It requires a little more than just checking a couple of boxes and clicking on a couple of buttons. But don’t let this scare you! Just relax and follow the steps I describe in this guide.

Let’s Install the Plugin

Download the WordPress MU Domain Mapping plugin, unzip the file, and install it manually as shown below.

1.Upload the sunrise.php file to the the wp-content folder.

2. Upload the rest of the content on the plugin folder (including the folder itself) to the /wp-content/plugins/ folder on your server.

wordpress multisite mappingwp mu domain mapping

Now, you need to edit the wp- config.php file to activate sunrise.php. This file is typically located in the root of your domain (e.g. the public_html folder).

Open the file and look for the line.

//define( ‘SUNRISE’, ‘on’ );
Uncomment it by deleting the two slashes //

 

Delete everything except define( ‘SUNRISE’, ‘on’ );

If this line of code does not exist on your wp-config file, just add it. Make sure to paste it above the line

 /* That's all, stop editing! Happy blogging. */

From your Network Admin Dashboard, go to plugins and activate WordPress MU Domain Mapping.

DNS mapping

Now you will see that you have two new items in your Network Dashboard/Settings:  Domain Mapping and Domains.  The Domain Mapping  is to configure the plugin and the Domains page is where we’ll actually map your domains to a site .

mapping pugin

Let’s Configure Domain Mapping

Click on Settings/Domain Mapping to set up the Domain Mapping functionality. The only thing you actually need to do is to enter the IP of the site where your WP Multisite is installed and check the boxes as shown below.

These settings are my personal preference. If you want to know what each option is for, please, check the plugin page .

To know the IP of your domain, you simply have to ping it. This is done by opening your command line window and typing ping www.your-domain.com

Let’s Map Our Domains

Everything is set up and ready to start adding new sites with their own domain to our WordPress Network.

First of all, make sure the name servers of the domain you want to add to your networks are set to the same hosting provider as the domain where you have WordPress Multisite installed.

Let me explain this a little better.

Name servers are what allow users to access your site by typing its domain name instead of its IP. What they do is to translate the domain names into IP addresses. The name servers of your domain are set where the domain is registered and provided by the hosting provider.

Let’s say you have your domain registered with GoDaddy but hosted on Hostgator. You will need to log into Hostgator to get your name servers and then go to GoDaddy and set the domain to point to Hostgator by entering the name servers they gave you.

Name servers typically look like:

NS1: nsXXX.hostingcompany.com
NS2: nsXXV.hostingcompany.com

 

If you need more information about how to set up the name servers of your domains, please, check the help of your domain registrar and your hosting provider.

To map a domain using WordPress Multisite Mapping, the domain-you-want to-add.com should have the same name servers that domain-where-wpms-is-installed.com.

Then, you have to park your domain on top of the domain where WordPress Multisite is installed.

If the domain you want to map is your primary domain, parking it is very simple. Log into cPanel, scroll down until Parked Domains and click on it. Enter the domain’s name of the site you want to add to the network. It should come back with a success.

parking a domain

If the domain where you have installed WordPress is an Addon domain, the procedure is different. Please, check out the post How to Park a Domain on Top of an Addon Domain to learn how to do it.

Once everything is set up on your hosting account and domain registrar, you are ready to map a domain to one of the sites on your network.  Let’s do it!

If your site has not been created yet, do it as you would do to create a regular network site.

mapping domains WPMU

Now,  map your domain to the desired site. This can be done in two ways:

  1. Through the Super Admin/Setting/Domains menu
  2. Through the Site Dashboard. This is my favorite method and the one I will show you.

Log into the site’s Dashboard and go to Tools/Domain Mapping. All you need to do is to put in the domain name, set it as the primary and press add.

map your new site

 And, this is it!

Enter your domain URL in the browser and you should see the new WordPress site. If you don’t, well… something went wrong, obviously. If this happens, don’t freak out. You have put in the wrong settings somewhere. Try to figure out what happened by going again through the whole process and, if you can’t fix it, please, leave a comment and I will try to help you out.
See you on the next post!

 

 

email