How to use WordPress Multisite With Different Domain Names?

There seems to always be a bit on confusion on this topic. Perhaps WordPress could do a better job guiding it’s users in this process. Although, I suppose Multi-site wasn’t intended to be used for TLD’s.

So first of all, I would install WordPress, setup multisite, and configure it as a subdomain network configuration.

Here’s a sample configuration for your wp-config.php file in the base directory of your WordPress installation:

/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
define( 'DOMAIN_CURRENT_SITE', 'www.primary-domain.com' );
define( 'PATH_CURRENT_SITE', "https://wordpress.stackexchange.com/" );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

Then, here’s the basic configuration for your .htaccess file as a subdomain configuration, in the base directory of your WordPress installation:

# BoF WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

# EoF WordPress

Now in order to get TLD’s to work properly, I’ve had to make some additional configurations to the wp-config.php file like this:

define( 'COOKIE_DOMAIN', '' );
define( 'ADMIN_COOKIE_PATH', "https://wordpress.stackexchange.com/" );
define( 'COOKIEPATH', "https://wordpress.stackexchange.com/" );
define( 'SITECOOKIEPATH', "https://wordpress.stackexchange.com/" );

That’s it with the WordPress specific configurations.

Personally, I like to have one Apache Virtual Host for the primary domain in the network and then configure that virtual host with alias domains. Each alias domain being one of the additional sites in your network.

However you end up tweaking your setup, you need each domain’s DNS to resolve to the same web server, and each domain to be pointed to the same directory the primary domain is installed with WordPress. Each domain in your network needs to point to the same web server with DNS records and share the same directory path for the files used by WordPress.

Once you’ve got everything configured and setup properly as discussed above. Log into your WordPress administration area and navigate to the Network administration area to add a new site into your network.

When you go to add a site, it will enforce you to add the website as if it were a sub domain under your primary domain. Just roll with it. Enter something temporary.

Once the site has been added, then go find it under the list of sites in your network. Click edit on that specific site. Now, you can fully 100% change the domain name of that website. That’s when you would put the actual domain name for this TLD site.

I know it’s a bit of trickery to do it that way, but it works and you don’t need to use any plugins.

Leave a Comment