How can I send 404 if subdomain is not found? For example if I have something like this:
<VirtualHost *:80> ServerName www.example.com DocumentRoot /var/www <all other stuff> </VirtualHost> <VirtualHost *:80> ServerName example.com DocumentRoot /var/www <all other stuff> </VirtualHost>
and open example.com, it opens correct page, if I try with subdomain www.example.com, it opens correctly. However if I try test.example.com (or any other subdomain) it still opens the same page, but I would like to send 404. Looks like very similar question to this one: apache2-virtualhosts-and-wildcard-subdomains, but I don't find a way to create 404 response.