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:
- Download ZIP file and unzip files into the subdirectory (eg “/mu/”)
- Open “/mu/wp-blog-header.php”
- Locate line 9:
if ( !file_exists( dirname(__FILE__) . '/wp-config.php')
&& !file_exists( dirname( dirname(__FILE__) ) . '/wp-config.php')) { - Edit this line to be:
if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) { - 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 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
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.
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.
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!
Thanks a lot for providing this information!
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! :)
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.
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.
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