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

时间:2022-10-06 08:08:12

I have the following .htaccess line, simple no indexes on root.

我有以下.htaccess行,简单没有根目录索引。

Options -Indexes

What do we add so it propagates to any sub directory instead of having to create one file for each? One .htaccess on root only.

我们添加什么,以便传播到任何子目录,而不必为每个子目录创建一个文件?一个.htaccess只在root上。

2 个解决方案

#1


35  

The correct answer is

正确的答案是

Options -Indexes

You must have been thinking of

你一定在想

AllowOverride All

https://httpd.apache.org/docs/2.2/howto/htaccess.html

https://httpd.apache.org/docs/2.2/howto/htaccess.html

.htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.

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

#2


30  

htaccess files affect the directory they are placed in and all sub-directories, that is an htaccess file located in your root directory (yoursite.com) would affect yoursite.com/content, yoursite.com/content/contents, etc.

htaccess文件会影响它们所在的目录,所有子目录(位于根目录(yoursite.com)中的htaccess文件)都会影响yoursite.com/content,yoursite.com/content/contents等。

http://www.javascriptkit.com/howto/htaccess.shtml

http://www.javascriptkit.com/howto/htaccess.shtml

#1


35  

The correct answer is

正确的答案是

Options -Indexes

You must have been thinking of

你一定在想

AllowOverride All

https://httpd.apache.org/docs/2.2/howto/htaccess.html

https://httpd.apache.org/docs/2.2/howto/htaccess.html

.htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.

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

#2


30  

htaccess files affect the directory they are placed in and all sub-directories, that is an htaccess file located in your root directory (yoursite.com) would affect yoursite.com/content, yoursite.com/content/contents, etc.

htaccess文件会影响它们所在的目录,所有子目录(位于根目录(yoursite.com)中的htaccess文件)都会影响yoursite.com/content,yoursite.com/content/contents等。

http://www.javascriptkit.com/howto/htaccess.shtml

http://www.javascriptkit.com/howto/htaccess.shtml