我已经查看了所有内容,但不断遇到有关目录级别 IP 限制的相同信息,通常看起来像这样:
Order Deny,Allow
Deny from all
Allow from 123.123.123.123
是否可以将相同类型的访问限制绑定(bind)到页面/文档?
最佳答案
有关更新的 Apache 2.4 示例:
<Files file.html>
Require ip 123.123.123.123
</Files>
以下是有关其他选项和示例的更深入的文档:https://httpd.apache.org/docs/2.4/howto/access.html以及
<Files>
的文档指令:https://httpd.apache.org/docs/2.4/mod/core.html#filesNote that
<Files>
can be nested inside<Directory>
sections to restrict the portion of the filesystem they apply to.
关于apache - .htaccess:如何通过 IP 限制对单个文件的访问?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3604526/