Manage Multiple WordPress Sites With One Database and One Code Base

// You can have multiple installations in one database if you give each a unique prefix

$domain_list = array();

// auto database name
$domain_list[“yourdomain.com”] = “”;\

$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 “Unknown error”; exit;
}


Multiple sites with 1database