Dynamic Url Routing Based On Subdomain.

Hello all,

I am facing a problem in dynamic url routing in my project, It is based on subdomain.domain.com.

The basic problem is that i am giving the registered users their own subdomain like this.


User.domain.com.

In this particual subdomain. each user has own setting forms.the users visiters can input the users unique URL to go directly to their subdomain.[size="4"]How can i differentiate the input URL to each username.domain.com and also the search result have URL like this


domain.com/users/details/id/133

which is also to be redirected to username.domain.com[/size]


'urlManager'=>array(

			'urlFormat'=>'path',

                        'showScriptName'=>false,

                        'caseSensitive'=>false,

			'rules'=>array(

                                'login/'=>'site/login',

                                'signup/'=>'users/signup',

                                'features/'=>'site/features',

                                'pricing/'=>'site/pricing',

                                'about/'=>'site/about',

                                'terms'=>'site/terms',

                                'privacy'=>'site/privacy',

                                'search'=>'site/searchsalon',

				'http://<user:\w+>.stuffuneedlocal.com/<controller:\w+>/<id:\d+>/'=>'<controller>/view',

				'http://<user:\w+>.stuffuneedlocal.com/<controller:\w+>/<action:\w+>/<id:\d+>/'=>'<controller>/<action>',

'http://<user:\w+>.stuffuneedlocal.com/<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

			),

		),

[size="4"]please help mee[/size]