本文介绍了Apache:阻止除列出的目录之外的所有目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我想阻止人们访问除了 /sandbox/WebDev/Projects

I want to block people from accessing every directory except for /sandbox, /WebDev and /Projects

我试过了:

<Directory ^/(?<!sandbox|Projects|WebDev)+(/.*)>
    Order Deny,Allow
    Deny from all
</Directory>

但它给出了 500 错误.

but it gave a 500 error.

推荐答案

规范方式类似于:

<Directory />
    Order Deny,Allow
    Deny from all
</Directory>

<Directory /sandbox>
    Order Deny,Allow
    Allow from all
</Directory>

<Directory /WebDev>
    Order Deny,Allow
    Allow from all
</Directory>

<Directory /Projects>
    Order Deny,Allow
    Allow from all
</Directory>

这篇关于Apache:阻止除列出的目录之外的所有目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 15:47