I have following structure of my web projects on my hard drive in /var/workspace/www/
firstdomain_com
\- www
\- anysubdomain
seconddomain_com
\- dev
\- api
\- www
I need to run all these applications on my local machine (and be able to use .htaccess properly) so I need to setup my /etc/hosts and /etc/apache2/sites-enabled/*:
/etc/hosts
::1 ip6-localhost ip6-loopback www_firstdomain_com.local
anysubdomain_firstdomain_com.local
/etc/apache2/sites-enabled/*
<VirtualHost www_firstdomain_com.local:80>
DocumentRoot /var/workspace/www/firstdomain_com/www
...
</VirtualHost>
<VirtualHost anysubdomain_firstdomain_com.local:80>
DocumentRoot /var/workspace/www/firstdomain_com/anysubdomain
...
</VirtualHost>
In case of much (sub)domains it seems to be boring and ineffective.
It is possible to set both Apache & /etc/hosts to be able to handle requests like this automatically without manual writing each of these hosts into /etc/hosts and apache conf separately? Is there any way to set some kind of "wildcard" or regex into both config files?
