通过htaccess限制访问,而不会出现错误AH01797

时间:2019-02-10 16:11:08

标签: apache .htaccess logging .htpasswd

如何编写干净的htaccess来使用密码(via.htpasswd)阻止访问,而无需在日志中填充消息

[Sun Feb 10 17:02:29.881424 2019] [access_compat:error] [pid 13885] [client 37.xxx.xxx.102:62836] AH01797: client denied by server configuration: /home/xxxxx/public_html/reporting/script.php

我目前在我的.htaccess中:

Order deny,allow
Deny from all
Require valid-user
AuthName "Reporting"
AuthType Basic
AuthUserFile /home/xxxxx/public_html/reporting/.htpasswd
AuthGroupFile /crm/null

它可以很好地保护代码,但会腐烂我的日志

感谢大家

0 个答案:

没有答案