Rewrite url to subdomain format

Hi all,

Is there anyone who can help me the solution for rewrite URL to subdomain format?

Example: I have this link example.com/index.php?cate=it , and I really want to rewrite and display it in format like: it.example.com

Thanks for your helps!

You may start with yii guide

Hi, Thanks yugene! I got it!

Hi leenhat

I also search the solution for it

But no luck yet.

Please help me to resolve the problem with step by step

ref: http://www.yiiframework.com/forum/index.php/topic/34839-rewrite-sub-domains-to-url-parameter-or-global-variable-value/

Note: just i want to get the language from my url’s subdomain to any global variable or url parameter