ちょっとした小ネタです。
例えば phpPgAdmin.conf がこんなふうになってるとき、
Alias /phpPgAdmin /usr/share/phpPgAdmin
<Location /phpPgAdmin>
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
</Location>
この場所に .htaccess を置いてBasic認証書いても効きません。
それは、Location の “Require all granted” が優先だから。
そんなときは、Location を Directory に変更すれば、.htaccess が優先されます。
Alias /phpPgAdmin /usr/share/phpPgAdmin
<Directory /usr/share/phpPgAdmin>
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
</Directory>
