Make Croogo Multisite

post_id: 57 / post_date: 2011-06-18

Making croogo multisite db and theme per domain consists of the following:

Am making the assumptions that db username is same for all sites, only the db will change. Also that the theme cannot be set from the admin panel, the theme with the name of the site will be used.



$hostName = $_SERVER['HTTP_HOST'];
  $siteNames = array('' => 's1', '' => 's2');
  $siteName = $siteNames[$hostName];
  define('SITE_DB', 'cselian_' . $siteName);
  define('SITE_THEME', $siteName);


  var $default = array(
    'database' => SITE_DB,


  //find the line commented below and replace with the SITE_THEME one.
  //$this->theme = Configure::read('Site.theme');
  $this->theme = SITE_THEME;