Why do people put empty index.html files into web directories?

I see that quite often other people's web-site directories have empty html index files (1 file per dir). AFAIK - that's been done to prevent website users from seeing directory content - right?

I usually disable indexing in httpd.conf differently:

<Directory />
   Order Deny,Allow
   Deny from all
   Options None
   AllowOverride None
</Directory>

What would be the reason to create index.html in every web faced directory instead of simply restricting indexing in apache config file?


  1. Httpd config is not always done by the same people as those who write the code / package the web site data. Putting empty index.html is one way to make sure the index is not displayed even if the config is incorrect.

  2. Additionally, it avoids displaying a "forbidden" error message should a user reach the index page, either through manually editing the URL or a broken link. This can be avoided, but it requires some config works, and that's a problem because ... see point 1.


I think there is no good reason for this. And i don't know people who do this.

Where do you see this? If you disable the indexing its the same and enough.

Edit: There is one reason. When the indexing is enabled and you have no access to the server config to change it.


Maybe because it works everywhere ? Apache, Lighttpd, Nginx, Glassfish, Tomcat, etc.