How to Disable Directory Browsing on Website or Blog

There are two ways to disable or turn off the directory browsing in on your linux server. The main reason for this is to secure your websites and prevent anyone from simply access your installation folders and directories. If the directories or files are exposed to view, this will bring serious security risk.

Follow below steps to disable directory browsing:

1. Turn off directory browsing using httpd.conf:-

–>Open your httpd.conf, vi /etc/httpd/conf/httpd.conf
–>on your Virtual Host and your documentroot setting, find “Options Indexes”
–>Modify exisitng Indexes to -Indexes if any. Else add the Options -Indexes
–>Restart your apache server
–>Finish

Options All -Indexes

2. Turn off directory browsing using .htaccess:-

READ  How to Fix "/etc/rndc.key: permission denied" for named Service Error

–>Go to your documentroot directory
–>Create or open your existing .htacces file and look for Options Indexes
–>Modify exisitng Indexes to -Indexes if any. Else add the Options -Indexes
–>Finish

Options All -Indexes

Leave a Reply

Your email address will not be published. Required fields are marked *