Home > Help Center > Applications > WordPress > WordPress Multisite with Subdomain URL

WordPress Multisite with Subdomain URL

WordPress Multisite

What is WordPress Multisite Network?

A multisite network is a collection of sites that all share the same WordPress installation. They can also share plugins and themes.

The individual sites in the network are virtual sites - they do not have their own directories on your server. They do have separate directories for media uploads and they do have separate tables in the database.

There is no limit to the number of sites on the network.

In several articles we are going to show you how you can build and manage your own network of WordPress sites.

URL addresses of WordPress Network Sites

WordPress Multisite works with two types of URLs - sub-domains and sub-directories and you must choose one or the other.

Sub-directories — a path-based network in which sites use paths:

domain.name

domain.name/site2/

domain.name/site3/

Sub-domains — a domain-based network in which sites use subdomains:

domain.name /public_html/site-folder/

site2.domain.name /public_html/site-folder/

site3.domain.name /public_html/site-folder/

Subdomains must be configured to work from the site's root directory.

If you use a separate domain for each site, these domains must be parked to the main domain.

In this article, we'll show you how to convert a standard WordPress site into a multi-site using subdomains.

Prepare Subdomains

We need to create three subdomains and map them to the same folder.

Our main subdomain is configured to work from the /wpmultisite directory:

wordpress multisite subdomain

In CPanel we create two more subdomains and configure them to the same directory /wpmultisite:

wordpress multisite subdomain

We also need a fresh WordPress installation.

Using Softaculous we install WordPress with a main domain wpmultisite.example.com and root folder /wpmultisite:

wordpress multisite subdomain

Allow Multisite

In order to enable multi-site functionality we need to modify two files in WordPress.

We will use the built-in cPanel file manager and code editor. You can use any code editor but if it is installed on the local computer be careful when transfer the files through FTP or File Manager Upload.

Click File Manager icon and navigate to site's directory public_html/wpmultisite

Select wp-config.php file and click on the Edit icon in the top horizontal menu.

Scroll down the file and find the row:

/* That's all, stop editing! Happy blogging. */

And just above it add this code:

/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );

Click Save Changes.

Install the Network

Log in to WordPress admin and click on Tools > Network Setup - this link did not exist before adding the code to wp-config.php file.

wordpress multisite subdomain

Select Sub-domains radio button:

wordpress multisite subdomain

Enter network title and administrator's email.

The user account associated with this email will get super-admin privileges over the entire network. We are going to discuss user management in another article.

Click Install button.

Enabling the Network

Follow the instructions on the screen. The instructions are customized for your installation containing the chosen type of URL (subdomains) and main site sub/domain.

  • Add the specified lines of code to your wp-config.php file
  • Add the specified lines to your .htaccess file

If you do not have a .htaccess file, then create it in the same directory as your wp-config.php file.

If you already have a .htaccess file, replace any existing WordPress lines with these new ones.

wordpress multisite subdomain

wp-config.php code:

define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'site-domain');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

Important: replace site-domain with your domain.

.htaccess code:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
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]

Click the log in link.

To finish network installation WordPress will log you out and you need to log in again.

Add Sites to the Network

There is a new My Sites icon in the upper left corner.

Hover the mouse over it and click on Network Admin > Sites in the dropdown menu:

wordpress multisite subdomain

Click Add New button.

Fill in all fields with correct information and click Add Site button:

wordpress multisite subdomain

Repeat the same step to add the third site.

Click Sites > All Sites to view the finished configuration:

wordpress multisite subdomain

Before testing the sites we can modify a bit the title and tagline of each site to make them look like they belong to a network.

Click Site > All Sites than hover over the URL and click Edit.

Click the Settings tab and edit the text in Blogname and Blogdescription fields as it is shown below:

wordpress multisite subdomain

Scroll down to the bottom of the page to click Save Changes button.

Repeat the above step for the other two sites.

Now let's test our network sites:

wordpress multisite subdomain

wordpress multisite subdomain

wordpress multisite subdomain

Congratulations. You have a working network of WordPress sites.

In our next article we will show you how to manage users, themes and plugins in WordPress Multisite.

#wordpress #multisite

Still not finding what you're looking for?

Contact our support team with any additional questions or concerns.

Contact support