A domain name is one of the most important parts of your website. It is the core identity of your online business that plays a significant role in your branding. As your online business grows, you might need to register multiple domains and connect them to your website.
However, setting up WordPress installations for each custom domain can be a complicated and time-consuming task. Thankfully, this is where domain mapping comes in handy.
To help you out, we will show you how to set up a custom domain on WordPress by using the domain mapping technique.
What Is Domain Mapping?
Domain mapping is the process of directing or connecting your domain name to a hosting server where your website’s files are stored. This is an essential process, especially if you purchase a domain name that is not already connected to or provided by your web host.
Domain mapping works similarly to URL redirection, but with one key difference. With domain mapping, visitors will stay on your custom domain even if the actual content is on a different host, instead of being redirected from one domain to another.
For example, if you have an eCommerce page on your website with yourdomain.com/productshelf as its URL, you might want to map it to a shorter URL like productshelf.com. With domain mapping, your visitors can access your eCommerce page through the shorter URL while still seeing the longer URL in their browser.
There are several cases where you might need to use domain mapping on your WordPress website, including:
- Building a custom landing page with its own domain to target a specific audience for a product or service.
- Creating pages on your site with a different domain for each language or country without using a translation plugin.
- SaaS or WaaS products give users the option to bring their own domains or provide vanity URLs.
- Multisite networks using the WordPress Multisite
How to Map Your Domain on WordPress
Mapping your domain on WordPress requires a process that can be tricky, especially for beginners. The process may also vary depending on your domain name registrar and hosting provider. Let’s look at the required steps to set up a custom domain for your WordPress website.
1. Purchase a Custom Domain
The first step of setting up a custom domain on your website is purchasing the domain name itself. Luckily, numerous domain name registrars offer many domain names to choose from with various top-level domains.
Use a domain checker tool, such as from Hostinger, to see if your desired domain name is still available. If it is already taken, try alternatives, such as different name variations or purchasing it from the current owner.
Once purchased, configure the name server and DNS for this custom domain to point to your hosting server correctly. This change may take around 48 to 72 hours, depending on your domain name registrar.
2. Prepare the Site
There are several aspects of your website to take care of before you start the setup process. Unless this is a fresh WordPress installation, we recommend backing up your database and files since the entire site will be updated during the process.
It is also recommended to deactivate all installed plugins before setting up the Multisite feature for your site. These plugins can be reactivated once the process is complete. If you plan to run WordPress from a custom directory, do that before activating Multisite.
3. Activate Multisite
There are two main ways to enable domain mapping in WordPress: using WordPress Multisite Network and using a plugin. To activate the Multisite Network feature on your WordPress site, define it by adding this line to your wp-config.php:
/* Multisite */
define( ‘WP_ALLOW_MULTISITE’, true );
Add this line above where it says /* That’s all, stop editing! Happy blogging. */. If you can’t find this line on your wp-config.php, add it above the first line that begins with require or include.
Save your changes and upload the file back to your server. Once you refresh your browser, you should find the Network Setup menu on your WordPress control panel.
Another option is to install a plugin such as Domain Mapping System. This plugin may require additional cost, but it can help manage many domains in a single WordPress site without having to switch between the sites in your network.
4. Add the Custom Domain to Your Hosting
Typically, the process of adding a custom domain to your hosting account is a straightforward step. Even though the exact steps may vary slightly depending on your hosting’s control panel, the general idea should be the same.
Log in to your hosting account and access the control panel. This function is usually available on the settings under domains or something similar. If your hosting uses cPanel, click on Aliases or the Parked Domain icon located under the Domains section
After that, all you have to do is enter your custom domain URL to add it to your account. The Aliases section also lets you manage other custom domains connected to your hosting.
5. Map a Subsite to a Custom Domain
Access your WordPress admin dashboard to add a new network site. Once you have activated Multisite, the Network Admin Settings will be at the top left of your dashboard.
Click on Sites, then add a new site by entering the URL, title, language, and admin email. Keep in mind that this new site needs a subdomain or subdirectory name when you first add them.
Once you add it, click on the Edit link option and add your custom domain to the Site Address field to map it. Then click Save Changes.
Conclusion
Domain mapping is not a straightforward process. A webmaster needs to take multiple steps before connecting multiple custom domains to their WordPress website. However, this effort can be highly beneficial for those who own larger websites with many pages and subdomains.
Thus, in this article, we have learned the definition of domain mapping and the five steps to activate it on your WordPress site. Here’s a quick recap of these steps:
- Purchase a custom domain
- Prepare the site
- Activate Multisite
- Add the custom domain to your hosting
- Map a subsite to a custom domain
Hopefully, by following the steps presented in this article, setting up a custom domain for your WordPress site will be easier.