Jun
02
2010

WordPress 3.0: Creating Multi-User Web Sites

by   |  Posted in Tutorials  |  12 comments

For the longest time, WordPress and WordPress MU have been two separate entities. Word on the street was they were attempting to merge the two platforms, but many of us thought it was too large of an undertaking to be ready for the release of WordPress 3.0. Thankfully, we were all wrong. WP 3.0 has integrated all of the core functionality of WPMU, though for some reason it is not an available feature by default. You need to take a few extra steps to activate it.

The first thing you need to do to get your multi-user network started is add this piece of code to your wp-config.php file:

define ('WP_ALLOW_MULTISITE', true);

Place it right before /* That's all, stop editing! Happy blogging. */, save it and upload it back to your site. You should now see a new link called “Network” under the Tools panel in your wp-admin. Click on that and you will be brought to this page:

Create a Network of WordPress Sites

Add a network title and an admin email address then click install.

Your network is now installed, but you need to add a bit more code to a few files to get it all working smoothly. Create a directory called blogs.dir in your wp-content folder. This is for uploaded media from your additional sites. It needs to be writeable by the web server so you have to set the permissions to 0666 (-rw-rw-rw-).

Next, you have to edit your wp-config.php file again. On the network page, there will be a piece of code similar to this:

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

Add this directly below the define ('WP_ALLOW_MULTISITE', true ); from above. Save and upload the file back to your server.

The last step requires you to add some code to your .htaccess file. If you don’t have one, create it and upload it to your root directory. If you use pretty permalinks, you will have to replace the original code in your .htaccess with the code below:

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).*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

Once you have completed all of the above, you will be prompted to log out and log back in. If everything is in place, you should now see a Super Admin panel in the top-left of your wp-admin. That’s where you will be able to create new sites and manage your multi-user network.

About the author:

A freelance web developer living in Montreal who spends most of his time writing for this site and building Premium themes for WordPress. You can find him on Twitter @bavotasan.

Site5 Affiliate Link
Share the love...

Tags:

Short URL: http://bit.ly/cZEA0n

Discussion 12 Comments

  1. covalic on July 20, 2010 at 3:03 pm

    What about update sql base?

  2. Bill on July 28, 2010 at 11:19 am

    Excellent information thank you.

  3. ged brindley on September 14, 2010 at 9:19 am

    Thank you sooooo much for this. It set me on the right track and I am getting through a major project to drag a school into the 21st century.
    Brilliant

  4. Jack Revington on April 18, 2011 at 11:38 pm

    Wow! You saved me a lot of time. I’m impressed with how easy-to-follow your instructions are. Thanks for making the post. I’m always thankful for people like you who take the time to explain what to put inside the .htaccess file as I still consider the contents of the .htaccess file to be mostly full of black magic that I can barely understand. Thanks again!

  5. Eddie Wright on April 19, 2011 at 9:02 am

    Thanks for the guide. A really helpful and quick way of getting around this. Keep up the good work!

  6. A. C. Grace on April 26, 2011 at 10:38 am

    Thank you for the code and very detailed instructions. You should be called The Wizard Of WordPress. There’s no way I could have figured this out myself. Again, many thanks!

  7. Domingo on May 4, 2011 at 10:50 am

    Thanks for the explanation.. Helped me a lot..
    thanks again

  8. Valerie on May 11, 2011 at 2:17 pm

    I’m new to WordPress, and I have no experience fooling around with wp-config.php and .htaccess, but you made it easy! Thanks!

  9. Yasmin on May 17, 2011 at 10:32 pm

    Worked perfectly, thanks. I will definitely pass it on…

  10. Kyle on May 18, 2011 at 11:28 am

    How do you think the multi-user environment for wordpress compares to the service ManageWP? I have started playing with both and I really like the layout of ManageWP. However, the cloning function is a little clunky. What I really would like is a good plugin for cloning in MU WP when using subdirectories. Any suggestions?

    • c.bavota on May 19, 2011 at 11:09 am

      I have never used that service, but I use the Multi-site function for WordPress on quite a few sites and I find that is is amazing.

  11. Steven J. Malman on June 1, 2011 at 1:37 pm

    Thank you so much for this information. I have a Chicago personal injury lawyer blog and I definitely need the multi-user function. I’ll try to add this code today.
    Steven J. Malman