I have two domains aliased to the same Apache vhost and thus targeting the same document root. The CMS installed in that doc root reacts with completely different websites depending on the domain that was used to access it.
I now need to implement a basic auth (in vhost config or .htaccess) that protects only ONE of the two websites. So access through one domain must be protected, while the other stays fully accessible.
My problem is that I do not find any Apache block directive that fires depending on the domain used for the access or depending on a server environment variable like HTTPHOST:
- <Directory> and <Files> are not appropriate as the target directory is the same for both domains.
- <Location> only looks at the path but not the domain.