Is it possible to turn apache’s
DirectoryIndex off for specific directory using
.htaccess file? I’ve tried
DirectoryIndex Off but if file
Off exists it uses it as index file. I want to make sure that the directory will be listed no matter what files are inside.
You have a couple of options:
DirectoryIndexto a filename that will never possibly exist.
Don’t load the
mod_dirmodule. This, however, will disable the
index.htmlstyle functionality for the entire server, and is probably not what you want.
Beginning with Apache 2.4 you can set
DirectoryIndex disabled to disable its functionality.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.