[eluser]Sarfaraz Momin[/eluser]
I have done it but to some specific subdomain names with wildcard set. Well you can still do it with a little help using .htaccess file. I want the same functionality in my existing project but I am still not to the point where I would need it. I have an example .htaccess file which might help you.
Code:
Options Includes +ExecCGI
Options +FollowSymLinks
RewriteEngine On
## Rewrite domain.com/ to welcome.domain.com/
RewriteCond %{HTTP_HOST} ^(site.com)$ [NC]
RewriteRule ^$ http://welcome.%1/ [R=301,L]
## Rewrite www.domain.com/ to welcome.domain.com/
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^$ http://welcome.%1/ [R=301,L]
## Rewrite domain.com/... to welcome.domain.com/...
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^((site)\.(com))$ [NC]
RewriteCond $1 !^(index\.php|runtime|robots\.txt|assets)
RewriteRule ^(.*)$ http://welcome.%{HTTP_HOST}/index.php/welcome%{REQUEST_URI} [QSA,L]
## Rewrite www.domain.com/... to welcome.domain.com/...
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://welcome.%1/index.php/welcome%{REQUEST_URI} [QSA,L]
## Rewrite something.domain.com/... to something.domain.com/...
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^((.+)\.)?((site)\.(com))$ [NC]
RewriteCond $1 !^(index\.php|runtime|robots\.txt|assets)
RewriteRule ^(.*)$ http://%{HTTP_HOST}/index.php/%2%{REQUEST_URI} [QSA,L]
## Fix trailing slash
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [L]
Have a good day !!!
-Sarfaraz