Date Posted: 22-12-2017

In this Post we will explain how to setup multisite in wordpress.

Step 1: Open wp-config file and find the copy-paste following code just above the “That’s all, stop editing! Happy blogging” comment.

define('WP_ALLOW_MULTISITE', true);

Step 2: Open the wp-admin in browser and goto tools->Network Setup and click install.

Step 3: After click install and you will get, complete the steps to enable the features for creating a network of sites.

Step 4: Add the following to your wp-config.php file in /var/www/html/ above the line reading /* That’s all, stop editing! Happy blogging. */:

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'domain.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

 

Step 5: Add the following to your .htaccess file in /var/www/html/, replacing 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]

 

Step 5: Download WPMU DEV Domain Mapping Plugin and install it.

Step 6: Open the wp-config file and find the copy-paste following code just above the “That’s all, stop editing! Happy blogging” comment.

define('SUNRISE', 'on' );

 

Step 7: Copy the wp-content/plugins/domain-mapping/sunrise.php file to wp-content folder. Use the following

cp /var/www/html/wp-content/plugins/domain-mapping/sunrise.php /var/www/html/wp-content/sunrise.php

 

Step 8: Go to Sites->Add new and add the sub domain.

Leave a Reply