Internet browsers permit users to randomly access directories on the Web server. To prevent users from locating and accessing files this way unless they know the exact path and file name, you must disable directory browsing on the Web server.
FACT : Apache web server allow directory browsing by default.
SOLUTION : There are 3 options for you to fix this
Using .htaccess
- Open your .htacces file
- Look for Options Indexes
- If Options Indexes exists modify it to Option -Indexes or else add Options -Indexes as a new line
Using httpd.conf
- Open your httpd.conf, normally it’s located at /usr/local/apache/conf or /etc/httpd.conf
- Go to your own virtual host settings and look for “Options Indexes”
- If Options Indexes exists modify it to Option -Indexes or else add Options -Indexes as a new line
- Restart your apache web server.
Using CPanel from your web hosting
- Login to your CPanel
- Go to the Index Manager inside the ‘Advanced’ setting
- Click on the directory name which you want to disable the directory browsing
- Select No Indexing and then Save


No related posts.









Leave a Reply