To enable a directory listing, we’d use this in Apache:
Options Indexes
How to list the directory content, including the default file that Apache serves when a directory is requested i.e. DirectoryIndex index.html?
Ideally, we can set this up per virtual host. My vhost file looks something like:
<VirtualHost *:80>
ServerAdmin my@email.com
DocumentRoot /some/path/
...
<Directory />
Options Indexes
</Directory>
</VirtualHost>
You could set the
DirectoryIndexdirective to a value, that might never occur as a filename on your filesystem:But once somebody adds a file named
!it will be served by apache instead of showing the directory index list. So it’s more or less an odd workaround instead of a proper solution.