What is the correct way to map multiple domains in a WordPress 4.1 multisite install?

WordPress Multisite can handle different domains by default – but NOT with alias domains. The settings of each site store the domain. On a default install there is a subdomain or folder-structure. But you can add a single domain.

Screenshots

For example, the first two sites are with the same domain (default from install) and the third site working with a different domain, external from the default. The last one is a different domain. No plugins or custom source for domain mapping are required.

enter image description here

Here’s a the screenshot of the settings of the last site with a separate domain:

enter image description here

If you want to reduce the cookie check for each login, add the following constant to wp-config.php.

define( 'COOKIE_DOMAIN', '' );

Otherwise WordPress will always set it to your network’s $current_site->domain, which could cause issues in some situations.

Domain Mapping with Alias

If you require deeper customisation, such as mapping aliases to domains, plugins can help you. WordPress Core hopes to provide Domain Alias Mapping in the future, but until then you can make use of one of the following plugins:

WWW vs Non-WWW

I don’t have the requisite knowhow about doing this with Non-WWW and WWW urls, but I think this case is slightly different. A domain like www.test.com has the subdomain www. But the www is a synonym for the web and often not interpreted as a subdomain. For all my clients, I rewrite to Non-WWW from the WWW address.

Hint for Creation of a new site

On the process, to create a new site it is not possible to add a external domain in the input field. Add an random value and after creation of the site, use the edit possibility to add the external site.

Leave a Comment