There are two important steps in WordPress multisite setup process. First is the multisite network creation and second is domain mapping. We already know the process in creating WordPress multisite network using subdomain install which includes create WP multisite network and add new subdomain site in the multisite network. After the completion of first step, we have the network of multiple subdomain sites in WordPress multisite. The second important thing is to add original site to the multisite network with help of proper domain mapping to individual subdomian site.
Example of WordPress multisite domain mapping with subdomain network
In this part, I will explain domain mapping concept with one example site. Consider adwordsshop.com as a site we wanted to add in the multisite network. Here we have the WordPress multisite network-enabled domain called seoreplay.com. The adwords.seoreplay.com is one of the subdomain sites we added in the multisite network. Adding subdoamin sites to the multisite network is explained in previous post.
Our goal is to add the domain adwordsshop.com to the multisite network. For this we need to map the domain adwordsshop.com to the existing subdomain (adwords.seoreplay.com) site in the multisite network.
How to do domain mapping in WordPress multisite network
Multisite domain mapping has different procedures based on where your sites are hosted. For instance, if you have three WordPress sites which are hosted in different hosting providers. For example, one site is in hostgator and second one is in DreamHost and third is in Servint. We need to add these three sites in one multisite network. For this, we have to do domain mapping between different Cpanel in different hosting company. Here the procedure differs from the normal.
First we will do domain mapping within single hosting Cpanel. Then we will see how to do domain mapping among two sites in different Cpanel within single whm. Later we will see domain mapping among two sites with different Cpanel and different whm.
Based on the hosting company and whm, the domain mapping procedure slightly varied.
How to do MU domain mapping within the single cpanel.
Consider our multisite network-enabled WordPress site and adwordsshop.com both in single capnel. Now the domain mapping process is simple:
- Install WordPress MU domain mapping plugin
- Cpanel Settings for Domain mapping
- Map the subdomain site in the multisite network with Original site (adwordsshop.com).
Install WordPress MU domain mapping plugin
WordPress plugins directory has the WordPress MU domain mapping plugin. We should install the plugin in the multisite network-enabled WordPress site (seoreplay.com). Use network admin instead of site admin to install the plugin.
The domain MU mapping plugin installation is same as the normal plugin installation in WordPress; only one additional step needed for configuration. The step-by-step installation procedure of WordPress MU domain mapping plugin in the WordPress multisite network is explained here.
After the plugin installation, go to the ‘domain mapping’ option under the settings tab in the network admin. Here you will see the configuration options Server Ip address and Server CNAME domain.
Here we should use any option CNAME or IP. If you use IP address. Just add the IP address of the multisite-enabled WordPress site (i.e A record of the multisite seoreplay.com). Remember it is better to use unique IP address for each site you want to add in multisite network. If you are using shared Ip for your multisite network you may uncounted some problem in future.
If you use CNAME for configuration, enter the CNAME for the multisite-enabled WordPress site. You can Use any option—either IP address or CNAME of the domain for configuration. I recommend to use CNAME here.
We need to add this CNAME in all individual site’s dns settings available in the multisite network. If you use IP address for configuration, we need to add that multisite IP as a record in all individual site dns settings. Don’t worry about this, we will see this during the individual site domain mapping.
We have five options in the domain MU mapping plugin settings. We have recommended “1” and “5”. We can also enable the third step, “Use domain mapping page”. If you check this option, you will see domain mapping page in all your network site dashboards.
The “5” option is used to redirect the admin login page of individual sites in the network. If you enable the “5” option, after the domain mapping, the original site login URL of the site will be redirected to the mapped subdomain sites in the network. If not the original login URL will be the same as before. It will not be redirected. These options won’t affect the multisite function; this is only for user’s convenience. You can select any option from ‘1’ to ‘5’ as per your convenience.
Now go to Cpanel settings Once we finished Cpanel settings Then we will map the original domain with subdomain site in the multisite network.
Cpanel settings for multisite domain network mapping
To map a site with the multisite network subdomain site considering both multisite and original in the same Cpanel, it requires the below three Cpanel settings.
- Subdomain settings
- Addon domain settings
- DNS settings
Check subdomain settings in Cpanel
Login to your hosting Cpanel and click on subdomains folder. This subdomain location differs based on hosting company. You will have the list of subdomains with document root as the multisite-enabled WordPress site path. Check if you have your multisite network subdomain site listed here (example adwords.seoreplay.com with document root public_html/seoreplay.com). If not, add the subdomain site with corresponding document root. In some cases, the subdomain is listed with some other document path. In this case, just edit the subdomain and give the correct document root as multisite-enabled WordPress site path then save it.
Check addon domain settings in Cpanel
Now on your Cpanel, click on addon domains. Here you will see the list of addon domain in the Cpanel. Check the original site (adwordsshop.com) that you want to map to the WordPress site multisite network subdomain. If the domain is already available as addon domain, then check the document root. If it is the multisite network-enabled site path, then there is no problem. Otherwise, add the original site (adwordsshop.com) that we want to map with network as an addon domain with the document root as multisite path. Note that in domain mapping, the document path must be a multisite path and should not be the original domain path.
DNS Settings for Multisite and Original site
Now the third thing is DNS settings. Some Cpanel may have simple DNS settings and advanced DNS settings. Some may have only DNS settings. If you have both simple and advanced DSN settings, go to advanced DNS settings.
Select the multsite network domain DNS settings and check the same subdomain available in the network here. If you have the subdomain, just leave it. Otherwise, do the first step ‘check the subdomain settings’ once again. Once you confirmed that the subdomain available in the multisite enabled site’s DNS settings with multisite IP then go to the next.
Now select the original site (adwordsshop.com) DNS settings if you have used IP address in domain mapping plugin settings. Here edit the A record of original site and add the multisite IP address in both www and non-www version.
If you have used CNAME in the domain mapping plugin settings, then add multisite CNAME in the original site CNAME records.
That’s all. Now we can map the original domain with subdomain in the MU network.
Map the subdomain site in the multisite network with original domain
We have configured the domain mapping plugin and DNS settings. Now we are ready to map original site with subdomain in the multisite network. For this, follow these steps:
- Click ‘All sites’ options under ‘Sites’ tab in the network admin dashboard. Here we have the list of subdomain sites we have added in the multisite network. The procedure to add new subdomains in the network is explained here.
- From the list of subdomain sites, click on the dashboard link of the one subdomain that you want to map with original site.
- It will open site admin dashboard of the corresponding subdomain site.
- Under the tools tab, click on ‘domain mapping’ in subdomain site.
- Here you have an option to add new domain using check box option as primary domain for this blog. In the “add new domain” box, we should add the original site we wanted to add in the network. We should add both the www and non-www version of the domain. The primary domain check box is used for setting the site URL.
For one new site domain mapping procedure, we have three URLs for the same content—one is subdomain site, second one is www version of original site, and third one is non-www version of original site. When you add new domain in the domain mapping, we have to choose which URL is the primary—either www or non-www version. Remaining two sites are automatically redirected to the primary URL we chose here.
Now you have done domain mapping properly. Now all the three sites—subdomain site, www and non-www version of the original site are mapped to one primary domain which was specified in the domain mapping settings. As a result of domain mapping, you will have the network admin link in dashboard of all original sites you have added in the network. The dashboard may be subdomain dashboard or original site (adwordsshop.com) dashboard and you will have network admin link.
If you want to map another domain with second subdomain site in the multisite network, just follow steps 2 and 3 in the domain mapping procedure within the single Cpanel. If you feel the procedure is so complicated We can easily setup wordpress multisite with wp.mu
Share your experience in comments section. In the next posts, we will show how to do domain mapping in two different Cpanels and how to add themes and plugin in the WordPress multisite network.