On 11/30/2020 02:20 PM, Michael wrote: > On Monday, 30 November 2020 20:07:10 GMT the...@sys-concept.com wrote: > >> Thank for looking into it and input. >> I must be missing someting because if I use in .htaccess file direcive: >> <Directory "/var/www/localhost/htdocs/*/admin"> or >> <Location "*/admin"> >> >> In both cases I get an error from Apache: >> >> [client 10.0.0.109] /var/www/localhost/htdocs/catalog/admin/.htaccess: >> <Directory not allowed here [client 10.0.0.109 >> /var/www/localhost/htdocs/catalog/admin/.htaccess: <Location not allowed >> here > > Yes, the error is because Directory and/or Location directives ought to go in > the main apache config files for this vhost, rather than in .htaccess. > > Is there a particular reason you want to use .htaccess, rather than files in > the /etc/apache subdirectories?
Access based on IP address works from .htaccess with Files directive: <Files *> Require ip 10.0.0.109 </Files> But it doesn't read AuthType Basic, it doesn't ask me for any password. AuthName "restricted stuff" AuthType Basic AuthUserFile "/etc/apache2/users" require user webmaster It seems to me Apache 2.4 is very limited what can, and can not go into .htaccess.