Controller name depending on domain

Hi,

How to configure system to choose diferent controller depending on domain - $_SERVER[‘HTTP_HOST’].

I’ve spent few days searching for the answer, but I found nothing.

Here is

domain1.com

controllers: /protected/controllers/domain1.com_ProjectController.php

views: /protected/views/domain1.com/project/*

domain2.net

controllers: /protected/controllers/domain2.net_ProjectController.php

views: /protected/views/domain2.net/project/*

etc.

Thanks in advance

Have you tried using Yii’s urlManager to do the proper routing? http://www.yiiframework.com/doc/guide/1.1/en/topics.url

Maybe with an url route like that:


array(

    'http://www.<domain:\w+>.<tld:\w+>/<controller:\w+>/<action:\w+>'' => '<domain>.<tld>_<controller>/<action>',

)