The Directory Indexing feature in cPanel allows you to specify what to display in a directory when viewed on the web.
A web server is usually configured to display the following:
- If present, a server will display the contents of an index file. Index files include
index.php
,default.html
, andindex.html
. - If an index file is not present, the server will display a directory listing.
An example list of Index files and a screenshot of the default directory listing in cPanel can be found in the Frequently Asked Questions section.
How to Configure the Directory Settings
Before you manage your Index settings, you may wish to configure the default directory to display the Indexes feature. You can also use these directory settings to find the relevant directory for a specific domain.
The first step is to log in to your cPanel admin area. Your web host will send you details on how to do this in your welcome email.
We’ve covered the different methods of logging in to cPanel here.
Under the Advanced Panel, click the Indexes Feature Icon.
The first step is to configure your directory settings. This allows you to set a directory from which to begin navigation.
To access the directory settings configuration screen, click the “Settings” button.
There are three options you can choose for your start directory, which is used when using the Indexes feature, which are:
- Home - This begins navigation from the home directory.
- Web Root - This begins navigation from the
public_html
orwww
directory, depending on how your server is configured. - Document Root for - Here, you can select the document root for one of the domains on your cPanel account.
If you wish to change settings for all websites on your account, we recommend selecting the web root. This way, you can view all the relevant directories without further navigation.
If you wish to change settings for a specific domain, you can select from the “Document Root for” dropdown.
To make these settings apply to all future uses of the Indexes feature, you should select the “Always open this directory in the future” checkbox.
Click “Save Changes” to save your settings.
How to Configure the Indexes Settings
The Directory Indexing functionality is contained within the Indexes feature. The tutorial below takes you through Configuring your Directory Indexing settings.
The first step is to log in to your cPanel admin area. Your web host will send you details on how to do this in your welcome email.
We’ve covered the different methods of logging in to cPanel here.
Under the Advanced Panel, click the Indexes Feature Icon.
The first step is to choose the folder you wish to configure by clicking the “Edit” button next to it under the “Actions” column.
Note:
Subdirectories can be set to inherit the settings of their parent. If you wish to configure the settings for all your websites, you can choose to edit the Web Root.
The Webroot is the public_html
or www
directory, depending on how your server is configured.
Select one of the following options in the Index Manager:
- Inherit — The directory inherits the parent directory’s index setting. If the parent directory does not have any setting the directory uses the system default settings.
- No Indexing — No directory contents are displayed. A “403 Forbidden” notice will be shown instead.
- Show Filename Only — Only filename information is shown.
- Show Filename and Description — The server lists file names and additional information, such as file size, last modified, and description.
You can view what each of these settings looks like here.
Click “Save Changes” to save your settings.
Frequently Asked Questions
What are Index Pages?
An Index Page is a file that automatically loads when a browser navigates to a directory on a web server.
Example Index files include:
index.php
, index.php5
, index.php4
, index.php3
, index.perl
, index.pl
, index.plx
, index.ppl
, index.cgi
, index.jsp
, index.jp
, index.phtml
, index.shtml
, index.xhtml
, index.html
, index.htm
, index.wml
, Default.html
, Default.htm
, default.html
, default.htm
, home.html
, home.htm
, index.js
.
What is the default cPanel Index configuration?
cPanel’s default indexes configuration will load an Index Page. If there is no Index Page, then a list of files and directories will be displayed, along with the following information:
- Name
- Last modified
- Size
- Description
A screenshot of a web page with no Index Page, using the cPanel default settings, is shown below:
What do each of the Index Settings look like?
The different settings in the Index Manager look like the following:
No Indexing:
Show Filename Only:
Show Filename and Description: