【发布时间】:2013-12-19 11:49:51
【问题描述】:
已获得此代码以供使用并在不更改的情况下使用它
<FilesMatch "^(?!log_request\.php).*$">
AuthUserFile /protect/.htpasswd
AuthName "Tester's test test"
AuthType Basic
Require valid-user
</FilesMatch>
ErrorDocument 401 /log_request.php
我不知道 FilesMatch "^(?!log_request.php).*$" 行的功能是什么,但文件应该匹配。当我尝试查看 .htpasswd 文件时,我得到内部服务器错误。
【问题讨论】:
-
你检查过你的日志吗?
/protect/.htpasswd是否存在(作为绝对路径 - 不是相对路径)? -
是的,应该是绝对路径