I have a virtual host setup on Apache 2 like so (simplified):
<VirtualHost *>
ServerName domain.com
ServerAlias *.domain.com
DocumentRoot /var/www/domain.com/html
</VirtualHost>
<VirtualHost sub1.domain.com>
ServerName sub1.domain.com
DocumentRoot /var/www/sub1.domain.com/html
</VirtualHost>
<VirtualHost sub2.domain.com>
ServerName sub2.domain.com
DocumentRoot /var/www/sub2.domain.com/html
</VirtualHost>
The outcome I'm looking for is everything that isn't sub2.domain.com or sub1.domain.com should go to the domain.com. They all have to be on the same default port and they all share the same IP address.
What actually happens is that sub2 goes to sub2 as expected, and everything else goes to sub1, i.e. the wildcard definition is ignored.
How can I fix this up?
Thanks!