View Categories

How to configure Directory Indexing in cPanel

3 min read

Introduction #

Directory Indexing is a feature of cPanel that allows you to configure how a directory will be viewed via the web. Typically the Web Server is configured to automatically open the index file when a website is accessed. As an “index file” the Web Server considers files named “index.php“, “index.html“, “default.html” and so on. If such a file is missing from the website’s directory the Web Server will return a directory listing which is similar to how the directories are listed in any file manager. To be able to configure if and how a directory will be listed cPanel provides you with a feature called “Indexes” and in the next few lines of this tutorial we will show you how to fully manage it. 

Accessing the Indexes feature in cPanel #

To be able to access any of the cPanel features you will first have to login to the cPanel service. Once logged in, you will be presented with a full list of all the features cPanel has to offer. To access the “Indexes” feature you will need to either use the search tool provided at the top of the page or you cal locate the “Advanced” features group and within it you should see the “Indexes” feature. 

Accessing the Indexes feature in cPanel

Clicking on the feature will take you to the default page of the same. There you will find more information on what the “Indexes” feature is used for and also all the required tools for managing the directory indexes.

Configuring Indexes for your Directories #

Immediately after you access the “Indexes” feature you will be presented with a complete list of all the directories associated with your Web Hosting Account for you to choose from. The way how the “Indexes” feature works is by choosing a folder and then by configuring the Indexing for that folder. To choose a folder, please click on the actual folder icon and NOT on the folder’s name. 

Accessing a folder

When you reach the folder for which you would like to configure the Indexes, please click on the folder’s name.

Choosing the folder for which to edit indexes

This will take you to a new page where you will be presented with the Indexing options for this directory. You can choose one of the following options:

  • Default System Setting – This option will consider the default settings of the Web Server for the directory indexes which is to list the content of the directory.
  • No Indexing – This option will instruct the Web Server to return a 403 error when this directory is being accessed over the web. 
  • Standard Indexing (filename only) – This option will only list the files and directories in the accessed folder without presenting details for those. 
  • Fancy Indexing (filename and description) – This option will list the files and folders of the accessed directory, however, it will also display information about the size and the date last modified.

Once you are ready with the configuration, please click on the “Save” button displayed at the bottom of the page. 

Choosing indexing options

cPanel will then redirect you to a new page where you will be provided with a message indicating the status of the index configuration you have just performed. 

That’s it! Congratulations, by now you should be fully aware of how to manage the indexes for the directories of your websites!

Powered by BetterDocs