Sub Domains

hi everyone,

i want to use a dedicated sub domain for each user like : username.example.com

i looked for it in yii guide and web.

in yii config file we should edit urlmanager like this :




'rules'=>array(

   'http://<username:\w+>.example.com' => 'company/view',

),



in localhost (Apache) and windows7 we should edit "C:\xampp\apache\conf\extra\httpd-vhosts.conf" and "C:\Windows\System32\drivers\etc\hosts".

for one sub domain (for example one username) it is easy to edit but for infinite subdomains how i should edit these file (or any other job to do)?

thanks

I would use wildcard domain in the dns settings and then redirect in apache vhost or nginx configuration

just for record my problem was with "C:\Windows\System32\drivers\etc\hosts" file that can not use wildcard in it.

i used Acrylic DNS Proxy and problem has solved.