Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache .htaccess文件选项-子目录上的索引_Apache_.htaccess_Apache2 - Fatal编程技术网

Apache .htaccess文件选项-子目录上的索引

Apache .htaccess文件选项-子目录上的索引,apache,.htaccess,apache2,Apache,.htaccess,Apache2,我有下面的.htaccess行,根上没有索引 Options -Indexes 我们添加了什么,以便它传播到任何子目录,而不必为每个子目录创建一个文件?1.htaccess仅在根目录上 htaccess文件会影响目录 它们被放置在 子目录,即htaccess 位于根目录中的文件 (yoursite.com)会影响 yoursite.com/content, yoursite.com/content/contents等 正确答案是 Options -Indexes 你一定在想 AllowOve

我有下面的.htaccess行,根上没有索引

Options -Indexes
我们添加了什么,以便它传播到任何子目录,而不必为每个子目录创建一个文件?1.htaccess仅在根目录上

htaccess文件会影响目录 它们被放置在 子目录,即htaccess 位于根目录中的文件 (yoursite.com)会影响 yoursite.com/content, yoursite.com/content/contents等

正确答案是

Options -Indexes
你一定在想

AllowOverride All

.htaccess文件(或“分布式配置文件”)提供了一种 以每个目录为基础进行配置更改。文件, 包含一个或多个配置指令,放置在 特定的文档目录,以及适用于该目录的指令 目录及其所有子目录


实际上是的,只是测试了一下。即使没有所有,它也适用于子文件夹@代码x73,Kaleb是对的:.htaccess。它是
AllowOverride All
感谢您指出这一点!我已经删除了这个7年问题的旧答案。