As of WordPress 3.0, you have the ability to create a network of sites (Multisite). This article is instructions for creating a network. It is very similar to creating your own personal version of wordpress.com.NOTE: If you are currently running WordPress MU, you do not need to complete these steps. your network is already enabled. Once you upgrade to the 3.x branch, you will be prompted to update your .htaccess rules for MultiSite.
Alert! If you have upgraded from WordPress 3.0, the Super Admin menu has been replaced with the Network Admin section. Look on your admin HEADER on the far right: it will say "Howdy, YOURNAME". On 3.1, the link is visible as 'Network Admin.' On 3.2, it's in a drop-down.
Before You BeginContents[hide]
- 1 Before You Begin
- 1.1 Admin Requirements
- 1.2 Server Requirements
- 1.3 WordPress Settings Requirements
- 2 Step 1: Backup Your WordPress
- 3 Step 2: Setting Wildcard Subdomains
- 3.1 Specific Configurations
- 4 Step 3: Allow Multisite
- 5 Step 4: Installing a Network
- 6 Step 5: Enabling the Network
- 7 Step 6: Network Admin Settings
- 8 Things You Need To Know
- 8.1 User Access
- 8.2 Permalinks
- 8.3 WordPress Plugins
- 8.4 Categories and Tags
- 8.5 Switching between subdomains and subfolders
- 8.6 Apache Virtual Hosts and Mod Rewrite
- 8.7 .htaccess and Mod Rewrite
- 8.8 Importing into WordPress Network
- 9 Related Articles
Admin RequirementsIf you want to run a network of blogs you should at least have a basic understanding of UNIX/Linux administration. A basic knowledge of WordPress development, PHP, HTML and CSS is recommended as well.
Setting up and running a multi-site installation is more complex than a single-site install. Reading this page should help you to decide if you really need a multi-site install, and what might be involved with creating one. If the instructions on this page make no sense to you, be sure to test things on a development site first, rather than your live site.
Server RequirementsSince this feature requires extra server setup and more technical ability, please check with your webhost and ask if they support the use of this feature. It is not recommended to try this on shared hosting.
You are given the choice between sub-domains or sub-directories in Step 4: Installing a Network. This means each additional site in your network will be created as a new virtual subdomain or subdirectory.
- Sub-domains -- like site1.example.com and site2.example.com
- Sub-directories -- like example.com/site1 and example.com/site2
It is also possible later, through use of a plugin such as WordPress MU Domain Mapping, to map individual sites to independent domain names.Sub-directory sitesIt works with the use of themod_rewrite feature on the server having the ability to read the .htaccess file, which will create the link structure.If you are using pretty permalinks in your blog already, then subdirectory sites will work as well.Sub-domain sitesIt works using wildcard subdomains. You must have this enabled in Apache, and you must also add a wildcard subdomain to your DNS records. (See Step 2 how to set up.)Some hosts have already set up the wildcard on the server side, which means all you need to add is the DNS record.Some shared webhosts may not support this, so you may need to check your webhost before enabling this feature.
WordPress Settings Requirements
- Giving WordPress its own directory will not work in WordPress 3.0 with multisite enabled. It interferes with the member blog lookup. If you wish to install WordPress in a folder AND have that folder name it will work. Domain mapping, however, will not work.
- You cannot create a network in the following cases:
- "WordPress address (URL)" is different from "Site address (URL)".
- "WordPress address (URL)" uses a port number other than ':80', ':443'.
- You cannot choose Sub-domain Install in the following cases:
- WordPress install is in a directory (not in document root).
- "WordPress address (URL)" is localhost.
- "WordPress address (URL)" is IP address such as 127.0.0.1.
- You cannot choose Sub-directory Install in the following cases:
- If your existing WordPress installation has been set up for more than a month, due to issues with existing permalinks. (This problem will be fixed in a future version. See Switching between subdomains and subfolders for more information.)
(See wp-admin/network.php for more detail)
Step 1: Backup Your WordPressYour WordPress will be updated when creating a Network. Please backup your database and files. Step 2: Setting Wildcard Subdomains(If this is a Sub-directories Install, skip this step.)
Sub-domain sites work with the use of wildcard subdomains. This is a two-step process:
- Apache must be configured to accept wildcards.
- Open up the httpd.conf file or the include file containing the VHOST entry for your web account.
- Add this line: ServerAlias *.example.com
- In the DNS records on your server, add a wildcard subdomain that points to the main installation. It should look like: A *.example.com
External links:
- Wildcard DNS record (Wikipedia)
- Apache Virtual Host (Apache HTTP Server documentation)
Specific ConfigurationsDue to the fact that every host is configured differently, the following 'per site' directions are not exhaustive. In all cases, if you cannot determine how to set up wildcard subdomains, contact your webhost for directions.
CPanel
Make a sub-domain named "*" (wildcard) at your CPanel (*.example.com). Make sure to point this at the same folder location where your wp-config.php file is located.
Plesk
There are several steps that differ when setting up the server for wildcard subdomains on a server using Plesk Panel compared to a server using cPanel (or no control panel). This article Configuring Wildcard Subdomains for multi site under Plesk Control Panel details all the steps involved.
DirectAdmin panel
Click "User Panel" -> DNS Management -> add the following three entries using the three columns: * A xxx.xx.xx.xxx
(Replace "xxx.xx.xx.xxx" with your website IP.) Click "Admin Panel" (If you have no "admin panel" ask your host to do this.) -> Custom Httpd -> yourdomain.com -> In the text input area, just paste and "save" precisely the following: ServerAlias *.|DOMAIN|
(If you ever need to un-do a custom Httpd: return here, delete text from input area, save.)
- DirectAdmin.com: Apache Wildcard Documentation... DirectAdmin.com forum: Wordpress wildcard subdomains.
Step 3: Allow MultisiteTo enable the Network menu item, you must first define multisite in the wp-config.php file.
Open up wp-config.php and add this line above where it says /* That's all, stop editing! Happy blogging. */: define('WP_ALLOW_MULTISITE', true);
Step 4: Installing a NetworkThis will enable the Network menu item to appear in the Tools menu. Visit Administration > Tools > Network to see the screen where you will configure certain aspects of our network. Tools Network SubPanel
Addresses of Sites in your NetworkYou are given the choice between sub-domains or sub-directories (if none of the above applies). This means each additional site in your network will be created as a new virtual subdomain or subdirectory. you have to pick one or the other, and you cannot change this unless you reconfigure your install. See also Before You Begin.
- Sub-domains -- like site1.example.com and site2.example.com
- Sub-directories -- like example.com/site1 and example.com/site2
Network DetailsThere are filled in automatically. Server AddressThe internet address of your network will be example.com.Network TitleWhat would you like to call your network?Admin E-mail AddressYour email address.
Double-check they are correct and click the Installbutton.
You may receive a warning about wildcard subdomains. Check Setting Wildcard Subdomains.
Warning! Wildcard DNS may not be configured correctly!
The installer attempted to contact a random hostname (13cc09.example.com) on your domain.
To use a subdomain configuration, you must have a wildcard entry in your DNS. This usually means adding a * hostname record pointing at your web server in your DNS configuration tool.
You can still use your site but any subdomain you create may not be accessible. If you know your DNS is correct, ignore this message.
Step 5: Enabling the NetworkThe rest of the steps are ones you must complete in order to finish. Tools Network Created
0. First, back up your existing wp-config.php and .htaccess files.1. Create a blogs.dir directory under /wp-content/This directory is used to stored uploaded media for your additional sites and must be writable by the web server. They should be CHOWNed and CHMODed the same as your wp-content directory.2. Add the extra lines your WordPress installation generates into your wp-config.php file.These lines are dynamically generated for you based on your configuration.Edit the wp-config.php file while you are logged in to your sites admin panel.Then just paste the generated lines immediately above /* That's all, stop editing! Happy blogging. */.
3. Add the generated mod_rewrite rules to your .htaccess file, replacing other WordPress rules.(If there isn't one, then create it.)These lines are dynamically generated for you based on your configuration.4. Log in again.Once the above steps are completed and the new wp-config.php & .htaccess files are saved, your network is enabled and configured. You will have to log in again. click "Log In" to refresh your Adminstration Panel. If you have problems logging back in, please clear your browser's cache and cookies.
Step 6: Network Admin SettingsIn 3.0, you had a new menu for Super Admin, but as of 3.1 you have an entire sub-section for Network Admin. The link can be found on the upper-right of all admin screens, by your name.
Go to the Settings panel to configure network options, and the Sites panel to manage your sites.
Things You Need To KnowHere are some additional things you might need to know about advanced administration of the blog network. User AccessBy design, all users who are added to your network will have subscriber access to all sites on your network.
Also, site admins cannot install new themes or plugins. Only the Network Admin (aka Super Admin) has that ability.
PermalinksWhile permalinks will continue to work, the main blog (i.e. the first one created) will have an extra entry of blog, making your URLs appear like domain.com/blog/YYYY/MM/POSTNAME.
This is by design, in order to prevent collisions with SubFolder installs. Currently there is no easy way to change it, as doing so prevents WordPress from auto-detecting collisions between your main site and any subsites. This will be addressed, and customizable, in a future version of WordPress.
Also note that the blog prefix is not used for static pages which will be accessible directly under the base address, e.g. domain.com/PAGENAME. If you try to create a static page in the first blog with the name of another existing blog, the page's permalink will get a suffix (e.g. domain.com/PAGENAME-2). If you create a new blog with the slug of an existing static page, the static page will not be reachable anymore. To prevent this, you can add the names of your static pages to the blacklist so that no blog with this name can be created.
WordPress PluginsWordPress Plugins now have additional flexibility, depending upon their implementation across the network.
- Site Specific Plugins: WordPress Plugins to be activated or deactivated by an individual blog owner are stored in the plugins directory. You need to enable the Plugins page for individual site administrators from Network > Options.
- Network Plugins: WordPress Plugins stored in the plugins directory can be activated across the network by the super admin.
- Must-Use Plugins: Plugins to be used by all sites on the entire network may also be installed in the mu-plugins directory as single files, or a file to include a subfolder. Any files within a folder will not be read. These files are not activated or deactivated; if they exist, they are used.
Categories and TagsGlobal terms are disabled in WordPress 3.0 by default. You can use the Sitewide Tags WordPress Plugin or other similar Plugins to incorporate global tags on the portal/front page of the site or on specific pages or blogs within the network to increase navigation based upon micro-categorized content. Switching between subdomains and subfoldersIf you have had WordPress installed for longer than a month and are attempting to activate the network, you will be told to use Sub-domain sites. This is in order to ensure you don't have conflicts between pages (i.e. example.com/pagename ) and sites (i.e. example.com/sitename ). If you are confident you will not have this issue, then you can change this after you finish the initial setup.
In your wp-config.php file, you'll want to change the define call for SUBDOMAIN_INSTALL:Use SubDomains define( 'SUBDOMAIN_INSTALL', true ); Use SubFolders define( 'SUBDOMAIN_INSTALL', false );
You'll also have to change your .htaccess to the new setup. Be aware, you may have issues if you attempt this after being on one setup or the other for any length of time, so proceed with caution.
Note that per the Settings Requirements you cannot switch from Sub-folder to Sub-domain when running on 127.0.0.1 or localhost. This can potentially cause an endless loop of reauth=1 on your root site due to cookie handling.
Apache Virtual Hosts and Mod RewriteTo enable mod_rewrite to work within an Apache Virtual host you may need to set some options on the DocumentRoot.
As a reminder, these are EXAMPLES and work in most, but not all, installs.
SubFolder Example # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L] RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L] RewriteRule . index.php [L] # END WordPress
SubDomain Example # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule . index.php [L] # END WordPress
Issues with old WPMU installs
If you installed Wordpress MU in subfolder/subdirectory (not in root folder on your server via ftp) and you have problem with image library, where thumbnails and images do not show, you may need to manually add in rewrite rules for your blogs file directories as follows: RewriteRule ^([_0-9a-zA-Z-]+/)?blogN/files/(.+) wp-content/blogs.dir/N/files/$2 [L]
Put those below the normal call for uploaded files.
Importing into WordPress NetworkWhen you've created your WordPress Network to import other blogs into, you need to look at the Migrating Multiple Blogs into WordPress Multisite article.