subdomain controller

Hi.

hi. I’m trying to make http://api.domain.com/dance/1 to work with the following rule





'urlManager'    => array

        (

            'urlFormat'=>'path',

            'showScriptName'=>false,

            'rules'=>array

            (

                '' => 'homepage/index',

                array('api.dance/stepup', 

                'pattern' => 'https?://api.' . $_SERVER['HTTP_HOST'] . '/dance/<id:\d+>', 

                'verb' => 'GET')

            )

)




which doesnt work as expected and leads me to the default SiteController with actionIndex.

What am I missing ?

Thanks in advance.

P.S. the DanceController.php file is located at protected/controllers/api/DanceControlle.php

Succeeded this way:


$host = str_replace('api.','',$_SERVER['HTTP_HOST']);


array(

   'api/<controller>/view', 

   'pattern' => "http://api.$host/<controller:\w+>/<id:\d+>",  

   'verb' => 'GET'

),

Try using the following for the protocol.




array(

   'api/<controller>/view', 

   'pattern' => "<protocol:https?>://api.$host/<controller:\w+>/<id:\d+>",  

   'verb' => 'GET'

),