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]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.
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(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:
External links:
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.)
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 SubPanelAddresses 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.
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 Created0. 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.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.Chat with our AI personalities