Protect Your Server By Turning Off Index Browsing

To disable directory browsing using .htaccess first locate and open the htaccess file. If you do not see a line that says Options –Indexes, create a new line and add it. Once the file is saved and uploaded your website is now secure.
For those of you who have cPanel 1nstalled on their hosting environment, first login to your cPanel dashboard. Next, click on Index Manager. From there you will be taken to a directory list. Click on the directory name which you want to disable. Select the No Indexing box, and click Save. The directory browsing feature is now disabled.
This simple 5 minute step of precaution could save you hours of hard work if your server was ever compromised. Here is an example of the 404 page you will be redirected to if you setup the htaccess file correctly.