How to Enable Multisite Feature in WordPress 3.1

Print Page

This tutorial will show how you can enable the multisite feature in WordPress 3.1. This feature is used when you want to run multiple sites from one install of WordPress without having to actually create many separate installs on the same server.

Update:
Steps to enable multisite feature in WordPress 3.2 is similar to WordPress 3.1. You can follow the steps below for that as well.

If you want to install WordPress on a new subdomain, check out that post instead.

Warning:
Backup up your database, wp-config.php and .htaccess files before beginning to revert incase you have any error.

Steps
First open wp-config.php located in the root folder of your WordPress blog directory. Add the below line to it and save.

define('WP_ALLOW_MULTISITE', true);

Make sure to add it above the line that says: /* That's all, stop editing! Happy blogging. */

Enable WordPress Multisite 1

The Network option, which is disabled by default, is enabled now. Go to the admin area of WordPress and you’ll see the menu item under Tools. Click on it!

Enable WordPress Multisite 2

Now you should see a screen like this:

Enable WordPress Multisite 3

Before you begin installation, decide what format you want?

  • Subdomain sites -> sub.mainsite.com
  • Subfolder sites -> mainsite.com/sub

Note:

  • To use the subdomain option, your web host will need to have the wildcard subdomains enabled.
  • Subdomain format is disabled by default if you are installing on localhost, if your URL is an IP address or if your main site is in a folder like

After making your choice, also set a name for your network and an admin e-mail address.

Once everything is complete, clicking “Install” will set up the extra network tables in the database and take you to a screen like the one below.

Enable WordPress Multisite 4

Now you will again need to open your wp-config.php file and paste in the code that looks like the following:

define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'mainsite.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

Paste it right under where you put the first code earlier.

Next open your .htaccess file, located in the same directory, and add the next set of code in it by replacing any existing WordPress rewrite rules. The code you get, something like below, depends on if it is a subdomain or a subfolder.

Subdomain .htaccess rules

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ [L]
# uploaded files
RewriteRule ^files/(.+) wpincludes/msfiles.php?file=$1 [L]
RewriteCond %{REQUEST_FILENAME} f [OR]
RewriteCond %{REQUEST_FILENAME} d
RewriteRule ^ [L]
RewriteRule . index.php [L]

Subfolder .htaccess rules.

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ [L]
# uploaded files
RewriteRule ^([_09azAZ]+/)? files/(.+) wpincludes/msfiles.php?file=$2 [L]
# add a trailing slash to /wpadmin
RewriteRule ^([_09azAZ]+/)? wpadmin$ $1wpadmin/[R=301,L]
RewriteCond %{REQUEST_FILENAME} f [OR]
RewriteCond %{REQUEST_FILENAME} d
RewriteRule ^ [L]
RewriteRule ^([_09azAZ]+/)?(wp(content|admin|includes).*) $2 [L]
RewriteRule ^([_09azAZ]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

Note:
If you have previously modified .htaccess file then make sure you don’t erase those changes. Place the code you get only between # BEGIN WordPress and # END WordPress.

Also create a new directory named “blogs.dir” under wp-content. This directory will contain uploaded media files from your different sites in the network.

Almost done now, login again using the link given at the bottom of the same screen.

If all goes well, you should now see a new “Network Admin” link on the left of the “Log Out” link.

Enable WordPress Multisite 5

Clicking on that will take you to the new Network Admin dashboard.

WordPress 3.1 Multisite Dashboard

Your entire network of different sites are managed from here. You can add new users, themes, plugins and make other changes from the dashboard.

That’s it! You have successfully enabled multisite feature in WordPress.

29 thoughts on “How to Enable Multisite Feature in WordPress 3.1”

Comments are closed.