« | »

Installing WordPress MU in subdirectory of existing WordPress blog

If only for my own sanity should I ever want to do this again, here are some useful tips for installing WordPress MU into a subdirectory on a webserver that already has a normal version of WordPress installed in the root. If that makes no sense to you then don’t worry, you probably don’t need to know:

  1. Download ZIP file and unzip files into the subdirectory (eg “/mu/”)
  2. Open “/mu/wp-blog-header.php”
  3. Locate line 9: if ( !file_exists( dirname(__FILE__) . '/wp-config.php')
    && !file_exists( dirname( dirname(__FILE__) ) . '/wp-config.php')) {
  4. Edit this line to be: if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) {
  5. Continue normal installation by going to “/mu/index.php”

The reason for this? If the MU installer detects the wp-config.php file in the root directory it thinks it’s already installed, but it isn’t. What it’s finding is the wp-config.php for the existing single-user version of WordPress.

There you go.

About the author

Patrick Kennedy

Patrick Kennedy is a user experience strategist and design researcher based in Sydney Australia. He leads research activities that improve the user experience of cross-channel products and services; helping both designers and business decision makers in bringing those products and services to fruition. Read more.

Comments

  1. mercime | April 6th, 2009 | 11:03 am

    Thank you for this information. I’ve installed WPMU in subdomain with subdirectory structure (wpmu.example.com/blog1etc) in some existing WP sites precisely because of that problem. Cheers and thanks again.

  2. adam | April 8th, 2009 | 10:06 am

    Thanks alot. Worked for me in installing a second wpmu in a subdirectory (for testing purposes). Seems to be a lot of people dealing with this but few with such a simple answer.

  3. Peter | May 23rd, 2009 | 4:42 am

    Just wanted to say thank you. I’ve been trying to work around this by installing it in a second subdirectory without any luck. You just saved me many a headache!

  4. PV | August 16th, 2009 | 9:20 pm

    Thanks a lot for providing this information!

  5. Kate | September 26th, 2009 | 12:20 am

    Brilliant! Thanks so much. I was just kicking around the idea of adding WordPress MU to an existing WP install. I’m sure this will save me time and a headache! :)

  6. Fern | October 13th, 2009 | 12:25 am

    Do you know if this problem exists when you do things the other way around (i.e. WPMU in root and WP in sudirectory)? I took a look at WP’s wp-blog-header.php file but it doesn’t appear to have the same code that you referenced above.

  7. Patrick Kennedy | October 13th, 2009 | 7:39 am

    I’ve not tried it but if that particular piece of code isn’t present then I’d say it shouldn’t be a problem.

  8. bcplteam | March 17th, 2010 | 8:27 pm

    Hi,

    I was wondering if installing wordpress in the subdirectory where root directory is of wordpressmu will cause any problem? Just reverse of this topic.

    Thanks

Post a comment