Domain mapping allows you to link multiple domains to specific content on a website or redirect them to another domain. This is commonly used for:
✔️ Pointing multiple domains to the same website
✔️ Mapping subdomains or subsites in multisite networks
✔️ Redirecting old domains to a new one
🔹 1️⃣ How Domain Mapping Works Technically
Domain mapping usually involves three key steps:
1️⃣ Pointing the Domain (DNS Configuration)
- The domain name needs to be pointed to the correct IP address or server.
- This is done by changing the A record (IP address) or CNAME record (alias) in the DNS settings.
2️⃣ Configuring the Web Server (Hosting Side)
- The web hosting service must be set up to recognize the mapped domain.
- This is done through cPanel, Plesk, or Nginx/Apache configurations.
3️⃣ Handling Requests in WordPress (If Applicable)
- If you’re using WordPress Multisite, it needs to recognize the mapped domain.
- You can use plugins like WP Multisite Domain Mapping or configure it manually.
🔹 2️⃣ Types of Domain Mapping
✅ 1. Primary Domain Mapping (Standard Website)
If you have multiple domains (e.g., example.com
, example.net
), you can map them to the same website.
🔹 How?
- Set the A Record of each domain to the same IP address in your DNS settings.
- Set up domain aliases in your hosting panel.
📌 Example:
example.net
andexample.org
both show the same website asexample.com
.
✅ 2. Subdomain or Subsite Mapping (Multisite WordPress)
In WordPress Multisite, each subsite can have its own custom domain instead of subsite.example.com
.
🔹 How?
- Point the custom domain (e.g.,
myshop.com
) to the multisite installation. - Use a domain mapping plugin or configure it manually in
wp-config.php
.
📌 Example:
subsite1.example.com
→customdomain.com
subsite2.example.com
→anotherdomain.com
✅ 3. Domain Forwarding (Redirection)
If you want visitors from oldsite.com
to be redirected to newsite.com
, you can use domain forwarding.
🔹 How?
- Set up a 301 redirect in your domain registrar or
.htaccess
file. - Alternatively, use a redirection plugin in WordPress.
📌 Example:
oldbrand.com
→ automatically forwards tonewbrand.com
.
🔹 3️⃣ How to Set Up Domain Mapping
🛠️ Method 1: In cPanel (For Shared Hosting)
- Log in to cPanel.
- Go to Addon Domains or Aliases.
- Add the new domain and link it to the existing website folder.
- Update the DNS records in your domain registrar.
🛠️ Method 2: In WordPress Multisite
- Enable Multisite in
wp-config.php
:define('WP_ALLOW_MULTISITE', true);
- Go to Network Admin → Sites and add a new site.
- Use a domain mapping plugin (like WP Multisite Domain Mapping).
- Update the DNS records for the new domain.
🔹 4️⃣ Checking If Domain Mapping Works
After setting up, test if the domain works by:
✅ Visiting the domain in a browser
✅ Using ping or nslookup to check the IP
✅ Waiting 24-48 hours for DNS propagation
💡 Need Help?
Let me know what type of domain mapping you need, and I can guide you step by step! 🚀😊