我试图拒绝使用.htaccess的子目录的直接访问:
# Deny direct access
<Directory "/cron">
Deny from all
</Directory>
上面的代码在我的public_html目录的.htaccess文件中。我要阻止的子目录位于public_html / cron。
当直接在浏览器中的/ cron文件夹中输入地址时,出现500服务器错误而不是403。为什么?
您不能<Directory>
在.htaccess
文件中使用。
http://httpd.apache.org/docs/2.2/en/mod/core.html#directory
上下文:服务器配置,虚拟主机
在/cron/.htaccess
文件中使用:
deny from all
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句