yii泛域名

 

 

 

 

return CMap::mergeArray(
require (dirname(__FILE__) . '/main.php'), 
array(
    'components' => array(
		'urlManager'=>array(
			'rules' => array(
 
			    //front end of sites
				'http://<module:\w+>.localhost/' => '<module>/default',
				'http://<module:\w+>.localhost/<controller:\w+>' => '<module>/<controller>/',
				'http://<module:\w+>.localhost/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>',
				'http://<module:\w+>.localhost/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<controller>/<action>',
 
				//admin subdomains for admin modules
				'http://admin.<module:\w+>.localhost/' => '<module>admin/default',
				'http://admin.<module:\w+>.localhost/<controller:\w+>' => '<module>admin/<controller>/',
				'http://admin.<module:\w+>.localhost/<controller:\w+>/<action:\w+>' => '<module>admin/<controller>/<action>',
				'http://admin.<module:\w+>.localhost/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>admin/<controller>/<action>',
			),
		),
    )
));

 

 

 

 

 

 

 

 

 

posted @ 2014-02-16 16:06  zhepama  阅读(200)  评论(0编辑  收藏  举报