In some cases for a better security or even by just your intention you may want to prevent files from being displayed for the public on your website where there is no index.php o index.html
To do so on Apache Webserver where you have root access just copy and paste the following code into your httpd.conf or modify the directive to the following just putting a minus behind Indexes
If you do not have root access you can modify .htaccess as it is apache configuration module instead by putting the above code that I will mention again into the .htaccess configuration file.
Related posts: