{"id":2983,"date":"2021-11-02T12:34:14","date_gmt":"2021-11-02T11:34:14","guid":{"rendered":"https:\/\/davidperezgar.com\/?p=2983"},"modified":"2024-08-04T10:46:00","modified_gmt":"2024-08-04T08:46:00","slug":"configure-wordpress-multisite","status":"publish","type":"post","link":"https:\/\/davidperezgar.com\/en\/blog\/configure-wordpress-multisite\/","title":{"rendered":"Configure WordPress Multisite"},"content":{"rendered":"\n

A WordPress Multisite<\/strong> is an installation that shares the same files, and generates different tables according to the different installations and therefore shares functionalities between them. <\/p>\n\n\n\n

It is a very smart<\/strong> solution for certain needs such as multi-language sites (like this one), multi-country, division of functionalities to make the main site less cumbersome.\n\n\n\n

This is because we can create\/install plugins for our different installations. It may happen that we activate an entire online store on a subsite in order to maintain maximum performance on the main portal. This type of installation usually occurs in very large sites<\/strong>. <\/p>\n\n\n\n

This guide is a compilation of different sites to be able to install the multisite with the two configurations: subdomains and subfolders.<\/strong> The subdomains option can also be used in the multidomain configuration. It will only be necessary once a subdomain has been created, to change its address to the final one.<\/p>

<\/p> At Closemarketing we have this Multisite WordPress Development<\/a> service<\/a>.<\/p>\n\n\n\n

The main site is the Official WordPress HandBook<\/a>, which the first thing it tells us to do is paste this line into the wp-config.php file:<\/p>.\n\n\n\n

define( 'WP_ALLOW_MULTISITE', true );<\/code><\/pre>\n\n\n\n

This will enable a new menu under Tools > Network Administration.\n\n\n\n

Subfolder configuration<\/h2>.\n\n\n\n

Configuration in wp-config<\/p>\n\n\n\n

define('MULTISITE', true);\ndefine('SUBDOMAIN_INSTALL', false);\ndefine('DOMAIN_CURRENT_SITE', 'domain.com');\ndefine('PATH_CURRENT_SITE', '\/');\ndefine('SITE_ID_CURRENT_SITE', 1);\ndefine('BLOG_ID_CURRENT_SITE', 1);<\/code><\/pre>.\n\n\n\n

Configuration in htaccess<\/p>\n\n\n\n

# BEGIN WordPress Multisite SUBFOLDER.\n<IfModule mod_rewrite.c>\nRewriteEngine On\nRewriteBase \/\nRewriteRule ^index.php$ - [L]\n\n# add a trailing slash to \/wp-admin\nRewriteRule ^([_0-9a-zA-Z-]+\/)?wp-admin$ $1wp-admin\/ [R=301,L]\n\nRewriteCond %{REQUEST_FILENAME} -f [OR]\nRewriteCond %{REQUEST_FILENAME} -d\nRewriteRule ^ - [L]\nRewriteRule ^([_0-9a-zA-Z-]+\/)?(wp-(content|admin|includes).*) $2 [L]\nRewriteRule ^([_0-9a-zA-Z-]+\/)?(.*.php)$ $2 [L]\nRewriteRule . index.php [L]\n<\/IfModule><\/code><\/pre>\n\n\n\n

Configuration-with-subdomains<\/h2>.\n\n\n\n
define('MULTISITE', true);\ndefine('SUBDOMAIN_INSTALL', true);\ndefine('DOMAIN_CURRENT_SITE', 'domain.com');\ndefine('PATH_CURRENT_SITE', '\/');\ndefine('SITE_ID_CURRENT_SITE', 1);\ndefine('BLOG_ID_CURRENT_SITE', 1);<\/code><\/pre>.\n\n\n\n

Htaccess if it is a subdomain<\/p>\n\n\n\n

# BEGIN WordPress Multisite SUBDOMAIN.\n<IfModule mod_rewrite.c>\nRewriteEngine On\nRewriteBase \/\nRewriteRule ^index.php$ - [L]\nRewriteRule ^wp-admin$ wp-admin\/ [R=301,L]\nRewriteCond %{REQUEST_FILENAME} -f [OR]\nRewriteCond %{REQUEST_FILENAME} -d\nRewriteRule ^ - [L]\nRewriteRule ^(wp-(wp-(content|admin|includes).*) $1 [L]\nRewriteRule ^(.*.php)$ $1 [L]\nRewriteRule . index.php [L]\n<\/IfModule><\/code><\/pre>\n\n\n\n
\n