InMotion Hosting Support Center

Proper structure is important when building a website. Including an index page in each folder is one of the basic steps to both design and security. By default, if a visitor lands on a subdirectory without an index page, they will see an "Index Of" page that lists all files and folders under that directory. This can be at the least embarrassing and unprofessional and at most a security risk. Follow the instructions below to learn how to stop the "Index Of" page from showing using the Index Manager in the cPanel.

How to prevent displaying the "Index Of" page via cPanel

  1. First, log into your cPanel interface.
  2. click on the tool iconLook through the categories listing on the right hand panel of the main cPanel page and find Advanced category. Click on the Indexes icon to continue.
  3. Select the domain by clicking on settingsIn order to select a domain, you will need to click on Settings. Click the drop-down arrow in order to select a different domain. Once you have selected your domain, click on Save changes.
  4. click which folder to protectNext is a page that lists all folders under the domain you previously selected. You can select any one folder to protect by clicking the name. If you select the root folder, the setting will cascade down to all other folders, protecting them all. In our 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.
  5. select No Indexing to disableYou are now brought to a screen where you can select the Indexing style you want to present. To prevent any index listing at all, simply select the No Indexing radio button. Click Save to activate your selection. Now you can visit your site and enter a subdirectory without 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.
    BeforeAfter
    before index protection enabledafter index protection enabled
Continued Education in Course cPanel
You are viewing Section 14: Preventing the "Index Of" listing page using the Index Manager
Section 13: How to Import MySQL Databases in Command Line
Section 15: How to find which users are attached to databases

Support Center Login

Social Media Login

   
Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Why is my home page displaying as an index list only?
VPS-1000S addon domains urls not working
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-04-16 12:32 am

hello...,good morning.inmotionhosting is a flexible tutorial for cpanel and webhosting.

n/a Points
2014-07-29 8:15 am
Thre is an explicit configuration option set within the "Index Manager" of "Default System Setting"

Where can I modify the default?
n/a Points
2015-02-12 8:30 pm
I followed all how to do but keep getting a "Enter user name and Password" in google browser, not a direct download starts? But I do not wish for any body to just access files from the directory only from link. How can I do this please?
n/a Points
2015-09-14 11:34 am

I had the same problem and followed the steps above in this example and got the 403 forbiden page.

So what next becaause i need to see my website online insteadof the 403 page.

thanks.

Staff
43,758 Points
2015-09-14 1:59 pm
Hello Yosia,

If you are now seeing the 403 it means that there is no index page for your site in that folder. You will need to upload one.

Kindest Regards
Scott M
n/a Points
2015-11-10 9:51 pm

Can we also put an index.php file in the directory redirecting back to the main index page of the site? Or, would this not be advisable?

Staff
10,077 Points
2015-11-11 12:53 am
Hello Craig,

That does work as well just requires different steps is all.

Best Regards,
TJ Edens
n/a Points
2016-05-02 5:04 am

Hi, I followed this article but for some reason my website's directories and files are still browseable. I also tried doing it manually, by adding Options -Indexes to my htaccess file, with no luck. Any idea where I'm going wrong? My site is in a subfolder in my public_html directory if that helps, although Idon'tt think that matters does it? 

Staff
43,758 Points
2016-05-02 5:39 am
Unless you have another .htaccess file in the subfolder that disables it, it should not matter. Have you cleared your browser cache to be sure it is not a browser issue?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

9 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!