Mapping a multi-site WordPress blog to a domain name

Mapping www.blog.name to your multi-site WordPress blog at example.com/blogname and ensuring the URL displays as www.blog.name while users view it involves a combination of domain mapping and WordPress Multisite configuration. Here’s how you can achieve this:

Prerequisites

  1. WordPress Multisite Setup: Have the Mutisite configured correctly. either as subdomains or subdirectories—subdirectories in this case.
  2. Domain Ownership: You need to own the domain blog.name and have access to its DNS settings.
  3. Hosting Access: You’ll need access to your hosting control panel (e.g., DirectAdmin, cPanel, Plesk) and WordPress admin dashboard.

Steps to Map www.blog.name to example.com/blogname

1. Configure DNS Settings for blog.name

  • Go to your domain registrar (e.g., GoDaddy, Namecheap) where blog.name is registered.
  • Update the DNS settings to point www.blog.name to your WordPress Multisite server:
  • A Record: Set www.blog.name to the IP address of your hosting server (e.g., the same IP as example.com).
  • CNAME Record (alternative): Point www.blog.name to example.com if you prefer a CNAME setup.
  • Allow some time (usually a few hours, up to 48 hours) for DNS propagation.

2. Add the Domain to Your Hosting

  • Log in to your hosting control panel.
  • Add www.blog.name as an addon domain or parked domain (depending on your host’s terminology):
  • Addon Domain: If your host supports it, point www.blog.name to the same root directory as example.com (where WordPress is installed).
  • Parked Domain: Alias it to example.com so it resolves to the same server.
  • Ensure the domain is recognized by your server alongside example.com.

3. Map the Domain in WordPress Multisite

  • Log in to your WordPress Multisite admin dashboard as a Network Admin.
  • Navigate to Sites > Add New (or edit the existing site for example.com/blogname).
  • If your Multisite uses a plugin like WordPress MU Domain Mapping (older method) or a modern alternative like WP Multisite Domain Mapping:
  • Install and activate the plugin across your network.
  • Go to the domain mapping settings (usually under Settings > Domain Mapping or similar).
  • Add www.blog.name as the custom domain for the site currently at example.com/blogname.
  • Set it as the primary domain so it displays www.blog.name in the browser instead of example.com/blogname.
  • If you’re not using a plugin (native Multisite since WordPress 4.5+):
  • Edit the site under Network Admin > Sites.
  • Update the Site Address (URL) to www.blog.name.
  • WordPress will handle the mapping natively if the domain is properly pointed to your server.

4. Update WordPress Configuration (if needed)

  • Open your wp-config.php file in the root directory of your WordPress installation.
  • Ensure the Multisite domain settings allow custom domains by adding or verifying this line:
  define('DOMAIN_CURRENT_SITE', 'example.com');
  • You don’t need to change this to blog.name, as it defines the main network domain. The mapping handles the rest.

5. Test and Troubleshoot

  • Clear any caching (browser, server, or CDN like Cloudflare) to ensure the changes take effect.
  • Visit www.blog.name and verify it loads the content from example.com/blogname.
  • Check that the URL remains www.blog.name in the address bar (this confirms the mapping works).
  • If you encounter issues:
  • Double-check DNS settings.
  • Ensure your .htaccess file is correctly configured for Multisite (especially if using subdirectories):
    apache RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

6. SSL Certificate (Optional but Recommended)

  • To secure www.blog.name, install an SSL certificate:
  • Use a free service like Let’s Encrypt via your hosting panel.
  • Update the site URL in WordPress to https://www.blog.name.
  • Test with https://www.blog.name to ensure it works.

Outcome

Once completed, visitors typing www.blog.name will see the content from example.com/blogname, and the browser will display www.blog.name as the URL. This setup leverages WordPress Multisite’s ability to map custom domains to individual sites within the network.

If you run into specific issues (e.g., hosting limitations, plugin conflicts), let me know your setup details (hosting provider, Multisite type), comment below and I’ll refine the advice!

Leave a Comment

Licensed under CC BY-NC 4.0

DevOps viewpoints are those of its owner. You may share and adapt this article for non-commercial purposes, provided proper attribution is given. Attribution should include:

Title: Mapping a multi-site WordPress blog to a domain name
Author: peter arthur martin
Original URL: https://www.woodcentral.com/-/peter/mapping-a-multi-site-wordpress-blog-to-a-domain-name/
License: CC BY-NC 4.0

Site Index

👍 This page answered my questions

Your vote helps other woodworkers quickly find the answers and techniques that actually work in the shop.