some pseudo code for your bootstrap (index.php) file:
$hostName=determine hostname being requested
$configFile=determine app config based on hostname
Yii::createWebApplication($configFile)->run();
For each hostname, you may have a separate application directory storing its own MVC code and config file. The config file specifies the 'basePath' property to point to the application directory.