InMotion Hosting Support Center

When working with your site there may be many files or folders. Ideally, most folders should have an index page of some sort. For our servers, they should be one of three names: index.htm, index.html, and index.php. As long as the folder contains at least one file with one of these names, it will display on the screen.

If, however a folder does not contain one of these files, then it will simply display a list of all files and folders contained within. This is the default behavior, but you can also change it within the .htaccess file. This article will guide you on how to prevent the list showing, even if the index pages are not in the folder.

How to prevent the Index Of page

  1. Log into your cPanel dashboard.
  2. Once in the cPanel, click on the File Manager icon, located in the Files catagory.
  3. Locate the .htaccess file and open it for editing.
  4. At the top of the file, add the following code:
    Options -Indexes
  5. Save and close the file.

Now when someone visits a directory or folder that has no index file, it will receive a 403 Forbidden error instead of seeing a list of the directory's contents. The 403 error indicates the visitor does not have access permissions to view that area.

Was this article helpful?
Continued Education in Course cPanel
You are viewing Section 19: Preventing the Index Of page in .htaccess
Section 18: How to Create Custom Error Pages in cPanel
Section 20: What to expect during a mass server migration

Related Questions

Here are a few questions related to this article that our customers have asked:
.htaccess Options -Indexes not working
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Post a Comment

Email Address:
Phone Number:

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

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


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:
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!