A Guide to WordPress Domain Mapping

Everything You Need to Know About WordPress Domain Mapping

WordPress domain mapping is a pretty neat feature. Should you ever find yourself needing to redirect a domain to a folder on your primary website or start offering reseller services like WordPress.com to open up new streams of income, then you may want to give this method a shot.

Domain mapping can be a bit difficult to grasp. Thankfully, WordPress offers plugin solutions that take the heavy lifting out of it. With this in mind, in this post, we’ll show you how you can get started with WordPress domain mapping and suggest some plugins to help you map your parked domains. But before we begin, let’s take a closer look at what domain mapping is and why you’d want to map your domains in the first place.

Let’s get started.

What Is Domain Mapping?

Domain mapping is a powerful feature that allows you to point multiple domains to your primary hosting account. If you want to associate a domain (and its many variations) to your website or redirect parked domains, then domain mapping is the way to do it.

WordPress multisite subsites may be mapped to a non-network top-level domain. This means a site created as subsite1.networkdomain.com, can be mapped to show as domain.com. This also works for subdirectory sites, so networkdomain.com/subsite1 can also appear at domain.com. – WordPress Codex

In simple English, when you map a domain to a hosting plan, the website that’s hosted on that plan will be displayed when a user accesses that domain name. For instance, if we were to map the domain www.nimbusmagazine.com to our primary site (i.e. www.nimbusthemes.com) it may look something like www.nimbusthemes.com/magazine.

Why Would You Want to Map Your Domain?

Whether you want multiple domains to point to a single hosting account or change the domain name of an existing website, domain mapping is the way to do it. That said, there are many other reasons why you may want to map your domain.

  • Switching over to a new CMS. Migrating your existing site’s CMS while keeping the URL is no cakewalk. If you’ve setup your entire website on a domain name and are receiving a good amount of traffic on it then you could potentially lose all of it if you switch over to a different CMS.
  • Point multiple domains to your hosting account. If your site’s domain name has a potential to be misspelled (either by your visitors or because it’s inherently intricate), then redirecting the various misspelled domains to your website can guarantee that you don’t miss out on that traffic.
  • Redirect your domain to a sub-domain on your site. Launching a product? Or maybe offering limited-time promotional discounts? Unless you want to spend hours integrating the promotions into your homepage, you can simply map your domain to a sub-directory on your site where the item of interest is placed.

If any of these use case scenarios seem like something you’re interested in doing, then read on to find out how you can map your domains in WordPress – the right way!

How Do I Map a Domain in WordPress?

Mapping a domain in WordPress can be a bit confusing simply because of all the technical terminology. In this section, we’ll show you how you can make the most of WordPress domain mapping by covering everything you need to know and nothing you don’t.

For this tutorial, you’ll need a domain name (or several domain names depending on why you’re domain mapping in the first place) that you want to map to WordPress. Before you begin, we recommend that you create a full backup of your website.

Step 1: Set Up Your Domain

The first thing you need to do is set up your domain. If you’re opting for WordPress.com then domain mapping can be as simple as buying your site’s URL to truncate the wordpress from it (i.e. change it from www.domain-name.wordpress.com to www.domain-name.com). All you have to do is configure the preferred primary domain from your WordPress.com account’s My Domains page.

However, if you’re going for a self-hosted site with WordPress as CMS, then chances are that you have a third-party hosting provider. This requires changing three fields from your hosting account’s cPanel – the host record, the alias record, and the nameservers.

  • Host Record. The host should be set to localhost.domain-name.com (or @) in the hosting account and should be pointing to a host record with the IP address of your primary site’s hosting account.
  • Alias Record. Your host should be set to ftp.domain-name.com. The alias record, in this case, should point to domain-name.com with your primary site’s URL.
  • Nameservers. A nameserver is an address that is used to link your domain to your hosting account’s IP address. This allows visitors to access your website. Typically, you get three different nameservers which may look something like ns1.domain-name.com, ns2.domain-name.com, and ns3.domain-name.com.

Generally, hosting packages include free domain mapping services, which means that you don’t have to worry about making the changes yourself.

Step 2: Add Your Domains to Your Hosting Account

Now that you have your domain all set up you can move on to adding even more domains to your hosting account and directing them all to your primary website. If you don’t want to add more domains to your hosting account, then you can skip to the next section.

However, if you’ve already bought the additional domains, then you need to direct them to your hosting account before you can bind them with your primary website. To get started, login to your cPanel and navigate to the Domains section.

Hosting account dashboard

Under the Shortcuts section, click on the Assign a domain to your cPanel account link.

Domains screen

In the following screen, you’ll be prompted to choose whether you want to assign a domain name that is already linked to your hosting account or assign a new domain name to it.

Enter the domain

Once you’re done with that, be sure to verify that you own that domain by following the instructions detailed by your hosting provider.

Verify the domain

Next, choose to assign the domain name as an addon domain. Finally, choose the addon directory and sub-domain. The addon directory field should already be populated with the default value. It should be the file path of your primary site such as public_html. Once you’re done, click the Assign this Domain button to continue.

Addon domain

You can add as many domains as you’d like following the steps outlined in this section. That’s it! Both of your domains have been assigned to the same folder.

Step 3: Link the Domains to Your Primary Site

Once you have all of the domains added, you’ll need to link them to your primary site by binding them with your hosting account. Navigate to Domains > Zone Editor from your cPanel account.

Zone Editor button

From the DNS Zone Editor screen, scroll down to the Add DNS Record section:

DNS Zone Editor form

  • Host Record. Enter localhost in this text field.
  • TTL. The TTL field should already be populated.
  • Type. Select A as the type.
  • Points To. Enter your cPanel’s IP address in this text field.

Click the Add Record button to continue.

Now, you can install WordPress by following the famous 5-minute installation guidelines detailed in the WordPress Codex.

Step 4: Direct Sub-Domains to Your Primary Site

Now that your domains are added to your hosting account, you’re in a position to create sub-domains for them and point them to your primary site. To kick things off, login to your cPanel account and head over to Domains > Subdomains.

Subdomains button

From the Subdomains screen, scroll down to the Create a Subdomain section, enter your sub-domain, and choose a domain from the drop-down menu.

Create a sub-domain

You’ll also have to enter a value in the Home folder (Document Root) field. To direct your sub-domain to your primary site, make sure the Home folder is set to public_html. Be sure to click the Create button once you’re done.

Since we want the sub-domain to point to our primary site, we’ll create an Alias Record (CNAME) for it. Same as before, navigate to Domains > Zone Editor from your cPanel account.

From the DNS Zone Editor screen, scroll down to the Add DNS Record section:

DNS Zone Editor

  • Host Record. Enter your primary site’s domain with a period at the end of it e.g. your-domain.com.
  • TTL. The TTL field should already be populated.
  • Type. Select CNAME as the type.
  • Points To. Enter the sub-domain you want to map.

Click the Add Record button to continue.

That’s all there is to it! Your newly created sub-domain should now direct to your primary site.

Can I Use a Plugin for WordPress Domain Mapping?

If you’re not particularly technically inclined or simply don’t want to mess around in your site’s hosting account, then you can opt for a plugin solution to help you with domain mapping.

Domain Mapping

Domain Mapping plugin

WPMU DEV’s Domain Mapping is a premium plugin that allows users to map domains to any site on their WordPress installation’s network or offer domain resale and mapping as a service. The plugin is incredibly easy to set up and, for the most part, adjusts to your network’s structure automatically.

Key Features:

  • Access to unique landing page URLs.
  • Mapped domain manager.
  • Built-in DNS record verification.
  • Support for WordPress Multisite.

Most of the free domain mapping plugins available in the WordPress Plugin Directory (such as WordPress MU Domain Mapping and Pronamic Domain Mapping) haven’t been updated in over two years or have very few active installs. You want to steer clear of inactive plugins, as they can present security risks along with a slew of other potential issues.

Conclusion

Whether you want to direct misspelled variations of your domain to your primary site or redirect your visitors to a sub-domain on it, domain mapping is the best way to go about it. Although it can be a little frustrating at first, mapping domains in WordPress allows you to do so much more with what you have.

Let’s quickly recap the main steps you need to follow to map a domain in WordPress:

  1. Set up the domain yourself if your hosting package doesn’t include free domain mapping services.
  2. Add as many domains as you’d like to your hosting account.
  3. Link the domains to your primary website and install WordPress on it (if it’s a new site).
  4. As an optional step, create and direct sub-domains to your primary site.

Do you have any questions about domain mapping in WordPress? Let us know by commenting below!

This post may contain affiliate links, which means Nimbus Themes may receive compensation if you make a purchase using these links.

Written exclusively for

Nimbus Themes Publishing Logo

About the Author

From C++ to PHP, the language Maria thinks in is code, and translates it to English for humans to understand. She has a degree in Computer Science and is the writer of choice for many organizations. She is also The Big Boss at BloggInc., calling all the shots and personally supervising every word and piece of content. In her spare time you can find her playing GTA V, lounging at the farm, or trying to beat her husband at indoor badminton.

Read all posts

Leave a Reply

Your email address will not be published. Required fields are marked *