We have our main website: www.example.com.
A partner has created a website: subdomain.theirexample.com and they have pointed it at our IP address.
We want to password protect any traffic coming through on the subdomain whilst leave the original domain open to the public. I've tried adding the below at the top of our htaccess file but we're not getting a password prompt:
SetEnvIf Host ^subdomain\.theirexample\.com$ passreq
AuthType Basic
AuthName "Password Required"
AuthUserFile /home/example/.htpasswd-theirexample
Require valid-user
Require all granted
Deny from env=passreq
Satisfy any
I also tried it simply like:
SetEnvIf Host subdomain.theirexample.com passreq