Multiple sites, one installation

I now have store.worldbeatplanet.com and www.worldbeatplanet.com sharing a single Drupal installation. I originally used two separate Drupal installations, although they already shared the same database (using different table prefixes). shareyourmusic.com also shares the same Drupal installation & database.

Drupal 4.6.x’s multiple site feature gives a lot of flexibility in allowing different sites to share some content yet keep other parts separate. Worldbeatplanet.com & Shareyourmusic.com both share the same content & user list, but with different appearances and different sidebar blocks. Store.worldbeatplanet.com has different content & different features, but it shares the user list with the other two sites. All of that can be easily accomplished using different table prefixes in the settings.php file for that site.

Example:

sites/
default/settings.php:
$db_prefix = '';

shareyourmusic.com/settings.php:
$db_prefix = array(
'blocks' => 'share_',
'boxes' => 'share_',
'menu' => 'share_',
'variable' => 'share_',
'cache' => 'share_',
'default' => '',
);

store.worldbeatplanet.com/settings.php:
$db_prefix = array(
'default' => 'store_',
'users' => '',
'role' => '',
'users_roles' => '',
);

One response to “Multiple sites, one installation

  1. Pingback: Drupal Taiwan | 正體中文支æ?´ç«™