【发布时间】:2012-02-29 03:48:52
【问题描述】:
我正在尝试对目录进行密码保护,但来自 localhost 的请求除外。 我的 .htaccess 看起来像这样:
AuthName "Login"
AuthType Basic
AuthUserFile /PATH/.htpasswd
Require valid-user
Allow from 127.0.0.1
Allow from ::1
Satisfy Any
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
ErrorDocument 404 /index.php
如果我删除 Allow 和 Satisfy 语句,目录将得到正确保护。当我添加允许(一个或两个)并满足任何时,它会生成 500 错误。日志说:
/PATH/.htaccess: allow not allowed here
有什么线索吗?
【问题讨论】:
标签: .htaccess