One particular common mistake done by many of us is not disable directory browsing its always good to turn off the directory browsing for security reasons.while accessing website visitor always redirect to index page if the index page does not exist server shows the list of files and directories.
By default server allows the directory browsing to all your visitors however some times we do not want our users to access the files and folders exist into web servers.This is really simple to avoid your web content to being display overall.Directory browsing can easily be disable through .htaccess but i feel easiest to do it from WHM/cpanel.
Disable Directory Browing from WHM
Here I explaining the steps to disable this via WHM panel, it’s really simple.
Step 1 : Log into WHM as root.
Step 2 : Go to Apache Configuration.
Home » Service Configuration » Apache Configuration
Step 3 : Click on Global Configuration.
Step 4 : Move to Directory “/” Options.
Step 5 : Uncheck Indexes.
Step 6 : Save then Rebuild Configuration and Restart Apache.
That’s it.
Disable directory browsing in cPanel
- Login to your control panel
- Click on Index Manager
- Select the website/sub domain you want to disable director listing for
- Select public_html from the list of folders
- Next click on ‘no indexing’ and click save
- Now directory browsing should be disable
That’s all we have to do.