Skip to main content

Multisite Domain Mapping and Configuration

How do you assign a custom domain to a WordPress Multisite subsite? See our guide for server routing, WordPress settings, and fixing cookie issues.

WordPress Multisite allows you to manage multiple distinct websites from a single, centralized WordPress installation. By default, new subsites are created either as subdirectories (example.com/subsite) or subdomains (subsite.example.com).

However, you can map completely custom, independent domains (such as anothersite.com) to any subsite within the network. Modern WordPress core supports this natively without the need for additional plugins.

A successful setup requires three steps: Seravo's server routing, DNS configuration, and internal WordPress domain settings.

1. Prerequisites: Routing, DNS, and SSL

Before modifying any URLs in WordPress, ensure that network traffic is properly routed to your site:

Custom Domains (e.g., anothersite.com)

  1. Notify Seravo Customer Support:

    Contact our support team well in advance. Seravo’s nginx server routing needs to be aware of the new domain beforehand so the server can accept incoming traffic and automatically install a Let's Encrypt SSL certificate for it.

  2. Point DNS Records to Seravo:

    Ensure that the new domain's A and AAAA records (as well as the CNAME for the www subdomain) point to your Seravo server cluster.

Subdomains (e.g., *.example.com) and Wildcard Certificates

If you are running a subdomain-based multisite and new subsites will use subdomains of your primary domain:

  • You can contact our customer service to request a Let's Encrypt wildcard certificate (*.example.com). We will provide you with a CNAME validation record (_acme-challenge) to add to your DNS.

  • Once you have added the wildcard DNS routing (* pointing to Seravo) and the CNAME record, and the certificate is activated, you can freely create new subdomains directly from WordPress without needing to request server routing updates for each one.

2. Configuring the Domain in the WordPress Dashboard

Once routing and DNS are configured, update the URL from the Network Admin dashboard (requires Super Admin privileges):

  1. Navigate to the top toolbar: My Sites > Network Admin > Sites.

  2. Locate your target subsite from the list and click Edit underneath its name.

  3. Info Tab:

    Enter the full new domain in the Site Address (URL) field (e.g., https://anothersite.com) and save the changes.

    Info tab in subsite settings.

    Screenshot of the subsite Info tab and the Site Address (URL) field

  4. Settings Tab:

    In the same view, switch to the Settings tab. Verify that both the siteurl and home fields have updated to the new domain (https://anothersite.com). If they still show the old address, update them manually and save changes at the bottom of the page.

    Settings tab in subsite settings.

    Screenshot of the subsite Settings tab showing the Siteurl and Home fields

3. Cookie Configuration in wp-config.php (Important)

When a Multisite network uses multiple different domains, WordPress login cookies may block access to a subsite's dashboard, displaying the following error:

"Cookies are blocked or not supported by your browser..."

To fix this, add the following line to your site’s wp-config.php file, just above the line that says /* That's all, stop editing! */:

define( 'COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] ?? '' );

You can edit this file via an SSH connection or via SFTP in the /data/wordpress/htdocs/ directory.

4. Fixing Database Links (Search-Replace)

If the subsite already contained content under its old address, internal links and image paths in the database must be updated. You must target the command strictly to the specific subsite using the --url= parameter:

wp search-replace 'https://example.com/subsite' 'https://anothersite.com' --url=anothersite.com --all-tables
wp-purge-cache

Note regarding the parameter: Because you completed Step 2 first, WordPress already recognizes the subsite by its new address (--url=anothersite.com). If you were to run this command before completing Step 2, you would need to use the old address as the parameter (--url=example.com/subsite).

Setting the Domain via Command Line (WP-CLI)

If you prefer managing your site via command line, you can complete Steps 2 and 4 at the same time using WP-CLI:

# 1. Check the subsite ID number
wp site list

# 2. Change the subsite address (replace '2' with your subsite's ID)
wp site set-url 2 'https://anothersite.com'

# 3. Update database links and purge cache
wp search-replace 'https://example.com/subsite' 'https://anothersite.com' --url=anothersite.com --all-tables
wp-purge-cache

A Note on Outdated Plugins (Mercator and Domain Mapping)

Older WordPress installations often relied on plugins like Mercator or WordPress MU Domain Mapping to route custom domains.

  • Modern WordPress does not require separate domain mapping plugins. WordPress supports independent domains natively following the steps above.

  • If your site still has Mercator or a similar plugin active, we highly recommend removing it and transitioning to native WordPress domain management. Our support team can assist you with safely removing the plugin if needed.

Troubleshooting and Exceptions

  • The site redirects to wp-signup.php?new=...:

    WordPress Multisite does not recognize the incoming domain. Check the following:

    • Primary Subsite Address: Ensure the domain has been added to Seravo's server routing (contact support) and is typed exactly right in the subsite's Info tab.

    • Alias Domains and Redirects: If you simply want an alternative domain (such as a parallel .net domain) to redirect to your subsite, the redirect should be configured at the nginx server level. This routes traffic to the correct destination before it reaches WordPress, preventing the signup error page. See our guide on setting up redirects: Can I add my own settings to the HTTP server (nginx)?.

  • Redirect Loop (ERR_TOO_MANY_REDIRECTS):

    Check the subsite's Settings tab to ensure both siteurl and home begin with https:// (not http://), and that both use the exact same domain format (either both with www or both without).

  • Browser Cookie Error Upon Login:

    Verify that you have added the COOKIE_DOMAIN definition to your site's wp-config.php file as outlined in Step 3.

  • Browser Displays an SSL Insecure Connection Warning:

    A new domain requires its own SSL certificate. Make sure the domain's DNS points to Seravo and the domain has been added to your site's server routing so that Let's Encrypt can issue the certificate automatically.

See Also

Managing custom domains in a Multisite environment is simple once server routing and WordPress URL fields are in sync. If you need to add a new domain to your server routing or require assistance updating URLs, Seravo's experts are happy to help at [email protected].

Did this answer your question?