I have an Apache2 configuration with multiple VirtualHosts. My DNS is set to accept *.<domain>.<tld> on multiple domains. Everything is working correctly but if I go to something-random-here.example.com I seem to get an invalid VirtualHost being selected (I am guessing the first or last one it finds). Is there a way to tell Apache to use certain rules if none of the VirtualHost entries match the domain or subdomain? I'd preferably like to return a 404.
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
|
||||
|
|
|
Apache uses the first virtualhost if no name matches. Just configure a new virtualhost as the first one with a random name, displaying whatever you like - or returning a 404 page. |
|||||||
|