Multiple WordPress Blogs in One Installation
I have been hosting multiple wordpress blogs in one installation for a few years now. I like that I can upgrade one installation, and they all upgrade. I don’t have to go through 10 different installs/upgrades.
There are a few things that can be considered either a pro or a con based on your point of view. If one blog uploads a theme or a plugin, it is available to all the others. This doesn’t mean that if one enables it, they all have to have it enabled. It’s just there, so each can install if they need to.
One serious downside is customization. If one blog customizes a template, another blog can’t use it unless they too want that customization.
On to the nitty-gritty, all I do is change the wp-load.php file and copy the wp-config.php file. I copy the wp-config.php to wp-config-DOMAINNAME.php (example wp-config-www.johncongdon.com.php). Each config file changes the database table prefix.
Here is a diff for the wp-load.php file. It just changes an if statement to load our individual config, if it doesn’t exist, it loads the original wp-load.php.
--- wp-load-orig.php 2011-03-07 15:18:12.000000000 -0500 +++ wp-load.php 2011-03-07 10:30:04.000000000 -0500 @@ -24,7 +24,12 @@ else error_reporting(E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING); -if ( file_exists( ABSPATH . 'wp-config.php') ) { +if ( file_exists( ABSPATH . 'wp-config-'.$_SERVER['SERVER_NAME'].'.php') ) { + + /** The config file resides in ABSPATH */ + require_once( ABSPATH . 'wp-config-'.$_SERVER['SERVER_NAME'].'.php' ); + +} elseif ( file_exists( ABSPATH . 'wp-config.php') ) { /** The config file resides in ABSPATH */ require_once( ABSPATH . 'wp-config.php' );
Jeff McCord 5:52 am on August 3, 2008 Permalink |
Couldn't agree with you more. As I replied on my blog (to your comment) I never even thought about that. Great points!!! The truth of the matter is I would get a better chance of getting my podcast out to "the masses" via iTunes than just putting it on my site. So I guess you'd have to weigh what's more important – comments or subscribers.
John Congdon 1:55 am on August 5, 2008 Permalink |
Yeah, I agree, but I think we could accomplish both with time. PodCasting is obviously a force to be reconned with, and I believe things will change.
Subscribers are important. You need people to see your message.