1. Home
  2. Linux
  3. General
  4. Preventing the "Index Of" listing page using the Index Manager

Preventing the "Index Of" listing page using the Index Manager

Preventing the "Index Of" listing page using the Index Manager
Preventing the “Index Of” listing page using the Index Manager

If you are building a website, it is important that you have a proper structure; this includes an index page in every folder which is a basic step in both design and security.
By default, when a visitor lands on a sub directory without an index page, they will be shown an “Index of” page which will display all of the files and folders below the directory. This can prove to be embarrassing, unprofessional, and even a security risk.
By following the steps of this tutorial, you will learn how to prevent the “Index of” listing page by using the index manager in cPanel.

For best VPS hosting and VPS management check the following;

  1. VPS Management
  2. VPS Hosting

How to prevent displaying the “Index Of” page via cPanel

Step 1: Begin by entering your cPanel interface.

Step 2: Look through the categories listing on the right hand panel of the main cPanel page for the ‘Advanced’ category. After this, click on the ‘indexes’ icon to proceed.

Step 3: To be able to choose a domain, first click on ‘Settings’ before using the drop-down arrow to choose the desired domain. After you chose your domain, click on ‘Save changes’.

Step 4: Now, go to a page that lists every folder under the domain you previously chose. You can choose any folder that you would like to protect by simply clicking on the name.
If you choose the root folder, the settings will cascade down to every other folder, protecting all of them in turn.
In this example, we will be choosing the ‘public_html’ folder since it is the root for our primary domain and we would like to protect every folder in that domain.
Step 5: You should now be brought to a screen where you may choose the Indexing style you’d like to present. To stop any index listing at all, choose the “No indexing” radio button before clicking on ‘save’ to activate your selection.
You can now visit your site and enter a sub directory without an index file. The site should be showing a 403 Forbidden page instead of the list of files.

One more thing..
Share this tutorial with your hosting administrators and networking experts friends, as it will help them and make my countless hours of work count.
Thanks.
Here are a few hand-picked guides for you to read next:

 

Updated on December 24, 2018

Was this article helpful?

Related Articles

Leave a Comment

[apsl-login-lite login_text='Please login with a social account']