When it comes to setting BasicAuth protection for specific directory, I use simple setup (in apache2.conf
file):
<Directory /var/www/somedir/>
Deny from all
AuthUserFile /var/pswd/somedir/.htpasswd
AuthName authorization
AuthType Basic
Satisfy Any
require valid-user
</Directory>
But I would like to set BasicAuth everywhere on the server by default, and unlock it only for specific directories (websites, domains).
So, how could one set BasicAuth everywhere on the server except certain directories?