title: CakePHP select database based on subdomain
body: <p>I am setting up a website that I would like to have different databases for a licensed user.</p>
  
  <p>The users will access their page via a subdomain. I would like this subdomain to choose the database to use.</p>
  
  <p>e.g.
  Client A db name = clienta</p>
  
  <p>URL = www.clienta.website.com</p>
  
  <p>This should tell CakePHP to select the database with name clienta</p>
  
  <p>I am using CakePHP 2.x</p>
  
  <p>Any advice would be excellent!!</p>
  
  <p>Thanks</p>