Make Virtualhost detect Wildcard with and without preceding www
- by jasondavis
In my Apache (Xampp) httpd-vhosts.conf file I have added this Virtualhost
It allows me to use Wildcard names like testserver1.dev and testserver2.dev I just have to make sure to add the name to my Windows Hosts file.
<VirtualHost *:80>
VirtualDocumentRoot E:/Server/htdocs/projects/%1/www
ServerAlias *.dev
</VirtualHost>
What I would like to do though is add to this funtionality and make it work if the name begins with a www so testserver1.dev would also work as www.testserver1.dev
The way it currently is set up, if I tried to access that URL, it would look in a folder called www.testserver1 instead of the folder testserver1