When working with websites and their files, you will always need to have an index file for each folder. If there is no index file and a visitor navigtes directly to that folder, they will see a list of all files and folders under that directory. This can cause some security concerns. You can, however, control that with the Index Manager tool in the cPanel.
Preventing the Index Of page via cPanel
- Log into your cPanel interface.
- From the main cPanel screen, look through the categories and locate the Advanced category. From there, click on the Index Manager icon.
- You will receive a popup box where you will need to select the domain you want to work with to protect. Click the Go button to continue.
- This page is a list of all folders under the domain you selected. You can select any one or multiple folders to protect by clicking the name. If you select the root folder, the setting will cascade down to all other folders. For example, we will select the public_html folder as it is the root for our primary domain and we want to protect all folders in the domain.
- You are now brought to a screen where you can select the Indexing style you want to present. To prevent any index listing, select the No Indexing radio button. Click Save to activate the selection.
- Visit your site and click on a folder that does not have an index file. You should receive a 403 Forbidden page instead of a list of files. Below is a before and after shot demonstrating how the No Index setting prevents the display of the file list.