【发布时间】:2015-08-31 04:00:19
【问题描述】:
我正在尝试使用 .htaccess 拒绝对子目录的直接访问:
# Deny direct access
<Directory "/cron">
Deny from all
</Directory>
上面的代码在我的public_html目录的.htaccess文件中。我试图阻止的子目录位于 public_html/cron。
当我直接在浏览器中输入 /cron 文件夹中的地址时,我收到 500 服务器错误而不是 403。知道为什么吗?
【问题讨论】:
-
不,但是当你得到 500 时,你的 apache 错误日志可以告诉你出了什么问题
-
@michael 我刚刚检查了错误日志,上面写着
<Directory not allowed here
标签: .htaccess