I have a VirtualHost in Apache which uses ServerAlias with a wildcard to match a lot of subdomains, like this:
<VirtualHost> ServerName foo.com ServerAlias *.foo.com </VirtualHost>
There are hundreds of subdomains which matches the alias, and now I want an authentication prompt for a specific subdomain:
How would one go about doing such a thing?
I have thought of creating a new VirtualHost for
bar.foo.com, but I would preferably like to avoid this, as it becomes a hassle once I want to add more domains like this.