How to do it...

Follow these steps to enable the Multisite feature in WordPress:

  1. Open the wp-config.php file in the root WordPress installation folder using the code editor.
  2. Add the following line to the wp-config.php file before That’s all, stop editing! Happy publishing in order to enable Multisite feature:
define('WP_ALLOW_MULTISITE', true);
  1. Upload the modified wp-config.php file.
  2. Log in to the WordPress Dashboard as administrator.
  3. Click the Tools menu.
  1. Click the Network Setup option to get the multisite configuration screen, as shown in the following screenshot:

  1. Add values for the Network Title and Network Admin Email fields. Then, click the Install button to install the multisite network.
  2. You will get a screen similar to the following, which contains details that you can use to configure the network:

  1. Back up the wp-config.php and .htaccess files.
  2. Copy the following content. This code is used to configure the multisite settings:
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'www.cookbook.wpexpertdeveloper.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
  1. Add the copied content to the wp-config.php file after the line we added in step 2 of this recipe.
  2. Copy the following content. This code is used to configure the rewrite rules for multisite:

# BEGIN WordPress
<IfModule mod_rewrite.c>
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]
</IfModule>

# END WordPress
  1. Replace the content in the htaccess file with the copied content.
  1. Log in again with administrator credentials. You will see the following screen:

You will see a new menu item called My Sites with a submenu item called Network Admin. These menu items confirm that the multisite features have been enabled on the site.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset