Site icon TheCreatology.com

Disable directory browsing to protect website using htaccess method

If your website is hosted on a Apache Web Server, then you should know that directory browsing feature is enabled by default. When a default file or index.html file is not present, server list downs all directory contents.  In order to protect website from hackers or other unwanted vulnerabilities, one should disable directory listing on the Apache server.

Disable Directory browsing

How to disable directory browsing ?

Directory browsing can be disabled by two ways, one is by editing the .htaccess file and add security to website which is located in root of the directory. Other method is by editing the httpd.conf file, which is the apache server file.

In my previous article How to improve website performance by Image Caching using htaccess, I explained about improving website performance and this article will cover a tip about website security.

Make sure before modifying file for any changes, I recommend you to backup all the website data.

Once htaccess file is uploaded, refresh the website / url, which is listing directory content. I hope this tutorial will secure your website. If you have any queries or any further assistance is required, you can post comment below, as your feedback.

Exit mobile version