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  Download Ubuntu 14.04 LTS for Server and Desktop

–>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 *

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee