Urlmanager Rules With Hostnames

I have two apps, one with the following url rule




'rules'=>array(

	'ht-tp://<org:[-\w]+>.localhost.com/<controller:\w+>/<id:\d+>'=>'<controller>/view',

	'ht-tp://<org:[-\w]+>.localhost.com/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

	'ht-tp://<org:[-\w]+>.localhost.com/<controller:\w+>'=>'<controller>',

	'ht-tp://<org:[-\w]+>.localhost.com/<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

				

	'<controller:[-\w]+>/<id:\d+>'=>'<controller>/view',

	'<controller:[-\w]+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

	'<controller:[-\w]+>/<action:\w+>'=>'<controller>/<action>',

)



    -- ignore the - in ht-tp://, i cant post links --

with this rule, url such as "company.localhost.com/controller/action" passes "company" to GET variable.

  1. Do i need the rules at the bottom? app works without them.

My second app is located in a sub-folder of the first app, i modified the rule to accommodate for the sub-folder and nothing gets passed to GET. this is how i modified it.




'rules'=>array(

	'ht-tp://<org:[-\w]+>.localhost.com/subfolder/<controller:\w+>/<id:\d+>'=>'<controller>/view',

	...

)



  1. How do i fix this rule to work from the sub folder.

Thanks.