- TUTORIAL STARTING
- ALLOW MULTISITE IN wp-config.php
- INSTALL THE WORDPRESS NETWORK
- ADD SOME CODE TO Config.php and .htaccess
- MENU NETWORK ADMINISTRATION AND THE NETWORK SETTINGS
In this tutorial we explain how you can install and set up a WordPress Multisite to build a network of websites. We assume that you already installed a WordPress Single Site. Moreover we assume you have FTP access to the directory of your WordPress installation, as you need to change some files.
Before proceeding with the installation of WordPress Multisite, it is essential to ensure that the following requirements are met:
- A WordPress installation should already be present.
- Pretty Permalinks should be activated, which means URLs should appear like http://example.com/my-page instead of http://example.com/?p=2345.
- All plugins must be deactivated.
- It is important to have a backup of the WordPress installation in case of any issues during the installation process.
- FTP access to the WordPress installation must be available.
Allow Multisite in wp-config.php
The first step is to activate the Multisite feature in the file wp-config.php.
Set up a FTP connection to your website.
Open the file wp-config.php, which is is located in the main directory of your WordPress, and add the line define(‘WP_ALLOW_MULTISITE’, true);
above the line:
/* That’s all, stop editing! Happy blogging. */
– Save the file wp-config.php.
Now you enabled the Multisite feature in your WordPress installation. But you haven’t finished yet. The next step is to install the network.
Install the WordPress Network
- Refresh the page in your browser and log in to your website.
- In the left sidebar under Tools you will find the menu tab Network Setup, where you can configure your WordPress Multisite.
- Decide whether you want to use subdomains for the sites in your network (e.g. site1.example.com) or whether you want to have them installed in subfolders (e.g. example.com/site1). This setting affects all the sites in your network, you cannot change that later on. Do you need a site to be mapped to a top level domain (e.g. mydomain.com)? This is possible with domain mapping.
- Enter a name for your network in the field Network Title in the section Network Details.
- Enter the site admin’s e-mail address.
- Click the Install button.
Add some code to wp-config.php and .htaccess
WordPress will now provide you with two snippets of code, which you need to add to the wp-config.php and .htaccess files. Both files are located in the root directory of your WordPress.
Set up a FTP connection to your website.
Add the first code snippet to your wp-config.php directly above the line :
/* That’s all, stop editing! Happy blogging. */
The snippet looks like this, but adapted to your own site:
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'My Website');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
Add the second code snippet to the .htaccess file and replace other WordPress rules.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
Save both files And move to the Next Step.
Menu network administration and the network settings
When you changed the wp-config.php and the .htaccess, log into your WordPress admin area again. In the upper admin bar, you now see the new menu Network Admin. It’s displayed always, so you can always enter the admin area of the network, no matter on which site of your network you are. We take a look at the sub menues later on.
Below the network administration, all sites of the network are listed to which you were added. By clicking on the names, you enter the backends of these sites.