I use domain.com and www.domain.com for my site on apache. But anything.domain.com also leads to domain.com. How can I disable all subdomains except www.domain.com to show 404 or just don't show anything?
The config now is as follows:
NameVirtualHost *:80 <VirtualHost *:80> ServerName domain.com ServerAlias www.domain.com ... </VirtualHost>