2.13.1.16. Multisite setup in WordPress
A multisite can be set up both on a pure WordPress site and on an already working site. In the second case, before setting up, you must create a backup copy of the site and base. In this article, the installation will be performed on a site named site.com
.
On subdomains
Customization
- Enable for site processing requests to non-existent subdomains.
- Openup Adminpanel site.
- Go to section "Tools → Network setup" and choose the appropriate view URL.
Address (URL) of a network site can be of three types:- Subdomain -
site1.site.com
,site2.site.com
(used by default). - Subdirectory -
site.com/site1
,site.com/site2
. - Separate domain -
site.com
,site2.com
.
- At the beginning config file site
wp-config.php
in the catalog/home/name_account/site.com/www
add the lines that WordPress will show. In this example, these are:define('MULTISITE', true); define('SUBDOMAIN_INSTALL', true); define('DOMAIN_CURRENT_SITE', 'example.com'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1);
- In file
.htaccess
in the catalog/home/name_account/site.com/www
replace all rules with the following: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] RewriteRule . index.php [L]
After completing these steps, your network will be activated and configured. You will need to log in to the site admin panel again to obtain super-administrator rights. There you will find a new option in the admin navigation menu called "My sites"... Network management must be carried out through this section.
Website development
Installing themes and plugins
Only the super network administrator can install themes and plugins. Installation is done through the section "Network management"... In addition to installation, you will also need to activate a plugin or theme for the web:
After this action, you can log into the admin panel of the created sites and use the themes and plugins that you have enabled for the network there.
On subdirectories
On different domains
In versions of Wordpress from 4.5.x, it became possible to organize a multisite on different domains without the need to install additional plugins. You need to set up multisite for subdomains or subdirectories.
- Add the required domains to aliases site.