Virtualhost Wildcard Subdomains

Posted by Khuram on Server Fault See other posts from Server Fault or by Khuram
Published on 2011-05-30T11:15:59Z Indexed on 2011/06/25 8:24 UTC
Read the original article Hit count: 243

Filed under:
|

We have one static IP on which we have routed our company website. We have setup a local machine on windows with WAMP to run our testing server.

We want virtual hosts to test our different apps. However, when creating subdomains, we have a new project which uses wildcard subdomains. How can we create the wildcard subdomains in VirtualHosts.

We use,

 NameVirtualHost *

<VirtualHost *>
    ServerAdmin admin@test
    DocumentRoot "E:/Wamp/www/corporate"
    ServerName  companysite.com
</VirtualHost> 

<VirtualHost *>
    ServerAdmin admin@test
    DocumentRoot "E:/Wamp/www/project"
    ServerName  project.companysite.com
</VirtualHost>

<VirtualHost *>
    ServerAdmin admin@test
    DocumentRoot "E:/Wamp/www/project"
    ServerName  *.project.companysite.com
</VirtualHost>

However, the last * wildcard does not work. Any help?

© Server Fault or respective owner

Related posts about apache

Related posts about virtualhost