Blog You-Big-Blog.com

One base – a lot of blogs – Eine Base für mehrere Blogs

Surely you have met (I mean users and fans of WordPress) with a situation where you want to install on a WordPress blog several different subjects, and how do they know not?
Recently, I accidentally „bumped“ into one of the acceptable options for the realization of this desire. In fact, it turned out, everything is easy!
little hack that will allow you to use a single database and code base for conducting WordPress several of your blogs.


$domain_list = array();
$domain_list["site1.com"] = "wp1_";
$domain_list["site2.com"] = "wp2_";
// TODO:
// Add entries for each blog
$domain_name = preg_replace("/^www\./", "", $_SERVER["SERVER_NAME"]);
if (array_key_exists($domain_name, $domain_list)){
$table_prefix = $domain_list[$domain_name];
if (!$table_prefix) { $table_prefix = "wp_" . md5($domain_name); }
}else{print "ERROR! No Fund!"; exit;}