Subdomain and Modules

I have question. Is it possible to assign subdomain to module? For example admin.domain.com to admin module.

There is a feature called "Parameterizing Hostnames" (described on this pages). You can do:




'components' => array(

   ...

   'urlManager' => array(

      'rules' => array(

         'http://admin.example.com' => 'admin/site/index',

         'http://admin.example.com/login' => 'admin/site/login',

      ),

   ),

   ...

),



So "admin/site/index" refers to the module "admin" with controller "site" and action "index".

Hi I am Ritu from India, I am using YII framework at one of my project and I am facing problem with Parameterizing Host Names, I have a module "ADMIN" and I want to display this as a subdomain within my domain, so I am setting rules like the following way from the protected/config/main.php:

'urlManager'=>array(


		'urlFormat'=>'path',


		'showScriptName'=>false, 


		'rules'=>array(


			'<controller:w+>/<id:d+>'=>'<controller>/view',


			'<controller:w+>/<action:w+>/<id:d+>'=>'<controller>/<action>',


			'<controller:w+>/<action:w+>'=>'<controller>/<action>',


			'www.admin.moresoccerfun.com/login' => 'admin/default/index',


		),


	),

But when I am running the page: www.admin.moresoccerfun.com/login from the browser, it is showing "SERVER NOT FOUND". Please help me out from this problem.

Thanks and looking for your response.

did you miss the ‘http://’ prefix ? :lol:

Hi I also experiencing the same thing. and not missing the http.

Please advice. Thanks :)