.htaccess File Options -Indexes on Subdirectories

Codex73 picture Codex73 · Nov 20, 2009 · Viewed 109.3k times · Source

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

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.

Answer

oasisfleeting picture oasisfleeting · Oct 5, 2014

The correct answer is

Options -Indexes

You must have been thinking of

AllowOverride All

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.