每个 IP 库的 Apache 目录列表限制

发布于 2024-10-02 12:09:32 字数 283 浏览 0 评论 0原文

我需要限制除某些 IP 之外的所有用户的目录列表。知道该怎么做吗?

它的选项应该是:

Options -Indexes

假设我需要限制的目录是 /restricted/

<Directory /restricted>
Options -Indexes
</Directory>

但如何对除 127.0.0.1 之外的所有目录进行 IP 限制

任何帮助将不胜感激

i need to limit the directory listing for all users except certain IP's. Any idea how to do that?

the option for it should be:

Options -Indexes

and let's say the directory i need to restrict is /restricted/

<Directory /restricted>
Options -Indexes
</Directory>

but how to place the IP restriction for all but, for instance, 127.0.0.1

Any help will be greatly appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冰魂雪魄 2024-10-09 12:09:32
Options -Indexes
<Files *>
deny from all
allow from 213.106.26.195
allow from 213.106.15.132
Options +Indexes
</Files>

我使用指令是因为我在 .htaccess 中尝试过它,但当然,在您的服务器配置文件中您也可以使用该指令。

Options -Indexes
<Files *>
deny from all
allow from 213.106.26.195
allow from 213.106.15.132
Options +Indexes
</Files>

I used directive because I tried it in .htaccess, but in your server profile you can use the directive as well, of course.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文