I want to prevent directory file listing in all of my folders, so when a user types http://example.com/thisDoesNotExists/
, the directory file listing do not show up.
According to a tutorial all I have to do is set IndexIgnore *
I try to set it in the httpd.conf
, so I do
<IfModule mod_autoindex>
IndexIgnore *
</IfModule>
at the bottom of the httpd.conf
.
It does not work. I get my 404errorPage.html
without any styles.
How can I fix this? Thanks.
Disclaimer : I try to set this in httpd.conf
and not htaccess
because "You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache http server. Any directive that you can include in a .htaccess file is better set in a Directory block, as it will have the same effect with better performance." According to this.