到目前为止,我有:
order deny,allow
deny from all
allow from 127.0.0.1/8
这会阻止我试图向除我之外的任何人隐藏的文件夹的顶级目录(不是根目录),但它不会阻止子目录。我仍然想访问该目录,并且我看到的所有示例都使用重写引擎来完全阻止来自子目录的访问。我如何也阻止子目录?这与第一个建议的问题相反:
到目前为止,我有:
order deny,allow
deny from all
allow from 127.0.0.1/8
这会阻止我试图向除我之外的任何人隐藏的文件夹的顶级目录(不是根目录),但它不会阻止子目录。我仍然想访问该目录,并且我看到的所有示例都使用重写引擎来完全阻止来自子目录的访问。我如何也阻止子目录?这与第一个建议的问题相反:
At first, I thought the closed beta packages I was testing were overriding my .htaccess file with their own, but they did not override any directory permissions.
At Kamil's suggestion, I looked into my httpd.conf and noticed that AllowOverride was set to None for the root directory of my web server. Setting it to All worked like a charm.
您引用的配置可以根据需要工作。
如果它确实仅阻止当前目录但您可以访问它的子目录-这就是我理解您的描述的方式-这意味着,您通过一些进一步.htaccess
和/或配置更改了访问规则,httpd.conf
即allow from all