Picture this: You have a main website, complete with all the key pages such as the home page, about page, services page, a blogroll page, several posts, informational pages, and a contacts page. Then you launch a new service or product that warrants its own domain, where all the service offerings and other related information about the service are going to be displayed.
However, you’d like to use some of the information already published on the main website for the new service or product. You also need to maintain all branding and other company nitty-gritty. What solution would you use to implement this? The best solution is to create a microsite using domain mapping.
With domain mapping, you can link a subfolder or subdomain to a custom domain intended only for the new service or product. Domain mapping allows you to connect multiple domains to a single web resource, in this case, a single WordPress instance.
That said, setting up domain mapping for the first time is a scary thought for many, but following the proper steps takes the anxiety out of the process. In the rest of this post, we go over the step-by-step process of setting up domain mapping for WordPress.
Prerequisites
- A WordPress installation with backend access
- Admin access to a hosting account
- Admin access to a domain name registrar
- The Domain Mapping System plugin
You can also watch our setup video on YouTube in addition to reading the rest of this article.
Step 1: Configure DNS for your Alias or Subdomain
Before you can add an alias or subdomain to your website, you need to first configure DNS records to point to your WordPress hosting server for the alias or subdomain. This means either buying an alias domain or setting up a subdomain of your existing domain with your domain registrar.
To do this, go to your domain registrar where you purchased your domain. Login to their dashboard and find your DNS record settings.
The goal is to set the exact same A Record that you have on your primary domain for your alias or subdomain. You can watch Part 4 of our 7 part video series that provides a detailed explanation of setting up A Records.
This is an example screenshot of what it might look like to manage your DNS records – notice the A Record designation on the left side, which should point to your hosting server IP address.
If your web host is also your name registrar, you may only need to make the changes in your hosting dashboard.
Step2 : Configure the Alias or Subdomain on your Server
While the idea of configuring an alias domain or subdomain sounds complex because it requires server configuration, the process is fairly easy if you’re using cPanel.
Most shared web hosts use cPanel for easy server management. Some web hosts use custom dashboards to configure server settings. Contact your hosting provider to find out how to create an alias or subdomain in your hosting Dashboard if you don’t have a cPanel-based host.
For this example, we’ll create a subdomain using cPanel.
Log in to your web hosting account and access cPanel.
Navigate to the Domains menu in cPanel.
This action will direct you to another form that prompts you to create a new domain, which is the same process used for creating a subdomain in cPanel. Simply click on the blue button to proceed.
This takes you to a new screen with a form input to enter your domain. Enter the full alias domain or subdomain URL into the text field.
Make sure the name matches what you’ve set up at the DNS level, then click the Submit button, and now you have a new alias domain or subdomain configured for your WordPress website.
It’s really important to ensure the “Document Root” is the same folder as your core WordPress installation, otherwise the new domain will not map properly.
After the domain is configured be sure to go to the SSL section of cPanel and there should usually be a method to automatically issue an SSL certificate for the new domain, which is required for all new alias domains or subdomains.
Contact your hosting provider if you get stuck anywhere or reach out to our support.
When you access that URL at this stage, you’re going to get a 404 error, indicating that there’s no resource set up yet for that subdomain.
Don’t worry; that will be sorted out in the next steps.
You can also watch a video tutorial on how to configure Addon domains, subdomains, and aliases on our YouTube channel below:
Step 3: Configure Domain Mapping System plugin
Download the free version of Domain Mapping System on WordPress.org here:
Install and activate the plugin. Once activated, you should see a Domain Mapping menu item located just below the Settings menu.
Clicking on it takes you to the Domain Mapping System dashboard.
The next step is to map the specific resource within our WordPress instance to the subdomain we created. With the free version, this can be a single post or page, a category index page of posts, or a custom post type.
The PRO version allows mapping more than one published resource to any single domain, which allows you to create Microsites (described below).
If you haven’t done so already, this is the right time to create the specific content pages for your subdomain. For instance, if you’re offering a new service that also includes multiple other microservices, you could create a home page for a specific target market or region, then you can map the subdomain to this new page.
For this tutorial, I’ve created a page for testing purposes. I’m going to map the newly created subdomain to this page.
To proceed, access the Domain Mapping System dashboard via the main WordPress menu.
Enter the alias domain in the URL input field, as shown in the image.
The Domain Mapping System plugin automatically populates all existing posts and pages in your WordPress installation, and makes them available in the drop-down selection.
Select the appropriate page to map from the drop-down list. Click the Save button afterward.
Creating Microsites
If you have the PRO version of the Domain Mapping System plugin activated, you can map several pages or posts of a WordPress website to a single domain. This feature is especially handy when creating Microsites.
Subdirectory mapping
At times, you may need to create a subdirectory-based Microsite.
With this approach, you can assign a subdirectory in addition to your alias or subdomain, allowing you to target different audiences without duplicating your content.
Here’s an example with an alias domain:
https://your-alias-domain.com/any-subdirectory
Here’s an example with a subdomain:
https://subdomain.your-domain.com/any-subdirectory
The Microsite homepage will exist at the URL above, and then any additional pages mapped to that alias or subdomain will have the slug after the subdirectory.
Subdirectory mapping is available in the PRO version of Domain Mapping System plugin, making the process of mapping to multiple content sources a breeze.
Step 4: Test your new URL
Everything should be set now if you followed the previous steps correctly. To test that everything is working fine, type the URL of your alias domain into the browser and run it.
Here is a demo page that is mapped to an alias domain using the same wordpress installation as our main website:
Step 5: Fix common issues
Setting up domain mapping for the first time can be error-prone. Fortunately, many of the issues you’re likely to encounter can be easily fixed with our Troubleshooting Guide.
Here are some of the more common issues and how to resolve them:nt?
- 404 error page
One of the most common errors encountered when setting up multiple domains for a single WordPress installation is the 404 error page.
This means that there is no web resource for the URL (subdomain or subdirectory URL) you’re trying to access. In terms of setting up domain mapping, a 404 error is typically a result of misconfiguring the root folder for the domain you’re mapping.
How to fix 404 errors:
To fix this, ensure that the root directory for the subdomain is the same as that for your WordPress installation.
- Incorrect DNS records
Another common cause of failures when setting up domain mapping is incorrectly configured DNS records.
How to fix:
The best way to handle DNS misconfigurations is to consult with your web hosting support. Most hosts provide detailed guides and may even offer to set it up for you. They will quickly determine whether your domain is correctly pointed at the right DNS.
- Conflicts with installed plugins
A common cause of WordPress plugin errors is incompatibility with other plugins. This may be the case with the Domain Mapping System plugin’s functionality being disrupted by other plugins.
How to fix:
Create a copy of your website on a staging setup and test out one plugin at a time. This way you can identify the offending plugin and isolate it.
- Improperly configured SSL certificates
When your browser throws a security warning, it’s likely that the SSL certificates for the mapped domain are not properly set up.
How to fix:
It may be that your newly configured domain has not fully propagated, in which case you have to allow time for full propagation. You may also want to check the validity and expiry dates of your certificates. If errors persist, consult with the issuer of your certificate for more technical intervention.
- Caching issues
Caching may prevent domain mapping changes from taking effect immediately.
How to fix:
Delete all browser cache data and purge all caches using your caching plugin
- Insufficient permissions on web host server
Some web hosts restrict access to certain files and directories, and this may affect domain mapping settings from being applied accurately.
How to fix:
Ensure that you have full access to tools such as cPanel or other custom DNS configuration tools before proceeding with domain mapping.
In summary
Setting up domain mapping for WordPress allows seamless integration of new content pages while maintaining brand consistency for each target market. By following these steps and addressing common issues, you can efficiently expand your online presence across multiple domains.