Apache 2.4:如何允许访问除其中的子目录之外的整个目录

时间:2015-04-08 18:42:19

标签: apache apache2.4

我在httpd.conf中尝试了这个但是它不起作用,我仍然允许我访问子文件夹“report”。

<Directory "c:/Apache24/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<Directory "c:/Apache24/htdocs/report">
    Require all denied
</Directory>

1 个答案:

答案 0 :(得分:-1)

目录中需要允许或拒绝。

<Directory "c:/Apache24/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<Directory "c:/Apache24/htdocs/report">
    Allow from None
    Order allow,deny
</Directory>

Apache文档中的更多详细信息:http://httpd.apache.org/docs/current/mod/mod_access_compat.html#allow