When working with WordPress Multisite, you can set them up in a number of ways. For example:
- on a subdomain: subsite.install.exampledomain.com
- on a subfolder: exampledomain.com/install/subsite
- on a subfolder of a subdomain: install.exampledomain.com/subsite
This guide will walk you through #1– setting up WordPress Multisite on a subdomain.
Setting Folder Structure
Much like configuring a multisite when you first install it, you will need to determine the folder structure with the WordPress Multisite. After installing the site, you will want to designate the Multisite setup in the wp-config.php file and run through the Network Configuration Setup in the WordPress dashboard. To start you will need to add the code to the wp-config.php file above the "/* That's all, stop editing! Happy blogging. */" line:
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
Once you've added that line in the wp-config.php, you'll want to move over to the WordPress Dashboard for the individual site. Then navigate to the Network setup section under Tools<Network Setup.
On the next screen, you'll be asked to Install the setup. You can designate the contact information needed like the site title and admin email. Then you'll be asked to add a few more lines of code to the wp-config.php and the .htaccess file:
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
define( 'DOMAIN_CURRENT_SITE', 'yourdomainname.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
This is the portion of the code where you will designate the subdomain or subfolder installation.
For a subdomain installation you will need the following code:
define( 'SUBDOMAIN_INSTALL', true );
For a subfolder installation, you can use this code:
define( 'SUBDOMAIN_INSTALL', false );
In the .htaccess file, add these lines:
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
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]
Subdomain Multisite off a Subdomain
If you choose to configure a Subdomain Multisite, you will need to set up the Wildcard subdomain for the installation.
Configuring SSL for Subdomain
To utilize the free SSL features that Reclaim offers, you will need to set up a wildcard SSL certificate. This is done within the Let's Encrypt SSL section under DNS Validation (dns-01). See Installing SSL on WordPress Multisite for the full process.
Running a Subdomain WordPress Multisite may seem tricky to set up, but with a few steps you'll be off and running in no time!