Installing WordPress Multisite

To install the multisite version of WP, you don't need to install WordPress differently; you just need to extend the configuration and switch WP to multisite mode.

Installation from scratch

Step 1 — Enable Multisite Installation

Before launching the first WordPress installation or after you have already installed WordPress — it doesn't matter.

Open the wp-config.php file from the main WordPress folder and add the following line:

define( 'WP_ALLOW_MULTISITE', true );

You can add the line somewhere at the beginning of the file, for example, before the database connection settings.

Step 2 — Start the Installation

After enabling MU installation, you need to go to the admin panel and navigate to Tools > Network Setup

Now you need to choose which type of network to install: subdomains or subdirectories:

  • Subdomains — each site in the network will have its own domain - a subdomain of the main domain: site1.example.com, site2.example.com.
    For this mode, you will need to configure the server so that any subdomain "points" to the folder where WordPress is installed. This is usually done by contacting your hosting provider's support. Alternatively, you can try to create a subdomain that starts with * - *.example.com in your hosting control panel.

  • Subdirectories — all sites in the network will have one domain: the main one, and will be located under it: example.com/site1, example.com/site2.
    For this mode to work, you need to enable pretty permalinks in the section: Settings > Permalinks.

Custom Domains

Starting from WP 4.5, custom domains can be specified for subsites (not related to the current network). For example, it used to be: network.com/subsite now it can be: arbitrarydomain.com. Read more in the codex: WordPress Multisite Domain Mapping

Which mode to choose depends on the tasks of your site network. Most often, it is better to choose the subdomain mode. There are fewer problems in the future with them — each site has its own personal domain, which means there are no potential URL conflicts, and in case of need, a separate domain can be purchased for the site. The subdirectory mode is suitable when "multisite" is used as a single network of something whole, for example, for creating a multilingual site.

After clicking the "Install" button, follow the instructions; it's all straightforward. In them, WordPress will ask you to add a few new lines to the files: wp-config.php and .htaccess.

You can always access this page via a direct link like: http://multiexample.com/wp-admin/network/setup.php

All done! The network is set up, and you need to log in to the site again, but now as a super administrator.

If the web server is Nginx, it needs to be configured separately. Read this article.

Installing MS on an Already Working Site

Multisite can be installed on a working site, and you can do this confidently if it makes sense, of course. But first, be sure to make a backup of the database and files — you never know what might go wrong…

Next, deactivate all plugins and enable pretty permalinks on the site if they are not already enabled. To do this, go to the admin page Settings > Permalinks.

Then, follow the instructions above for "Installation from scratch".

Switching Modes: Subdomains and Subdirectories

If the site has existed for more than a month, when enabling MU installation, only the subdomain mode will be available. This is to spare you potential conflicts between pages and sites; for example, the URL of a sub-site (blog) could end up being the same as the URL of the main site's page: example.com/superblog (sub-site) and example.com/superblog (main site page).

If your site is not at risk of this, the mode can be changed at any time.

To change the mode, modify the SUBDOMAIN_INSTALL constant in the wp-config.php file:

define( 'SUBDOMAIN_INSTALL', true ); // sub-domains

define( 'SUBDOMAIN_INSTALL', false ); // subdirectories

You will also need to update the .htaccess rules.

You can find the correct rules after changing the mode on the admin panel page: Network Management → Settings → Network Setup. Sometimes this page may be hidden, in which case go to a direct link like: http://example.com/wp-admin/network/setup.php