How to configure directory indexes in cPanel

This article describes the way to use cPanel to define how your website handles directory listings.

Index options

cPanel enables you to specify how directories on your website are displayed. By default, if an index file isn’t in a directory, the directory's contents are listed in the user's browser. This is usually not recommended and is a potential security issue.

You can set one of four options for any directory:

  • Inherit: This option uses the parent directory's setting. If the index settings aren’t defined in the parent directory, the system will use its default settings.
  • No Indexing: This option specifies that if an index file isn’t present, a directory listing (e.g. no files will appear for the directory) isn’t displayed.
  • Show Filename Only: This option specifies that if the default file is missing, a simple list of the files present will display.
  • Show Filename and Description: This option shows a list of files and their attributes: file size and file type.


"If any sort of index file (for example, index.php, index.htm, or index.html) exists in a directory, the user sees the index file regardless of which indexing option is set for the directory."


Modifying a directory's index settings

To modify a directory's index settings, follow these steps:

1. Log in to cPanel.

2. In the ADVANCED section of the cPanel home screen, click Indexes:

  

3. Click the directory name that you want to modify.

4. Click the indexing option that you want to set for the directory.

5. Click Save. The new setting takes effect immediately.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How can I change a database password on cPanel?

Changing MySQL database password via cPanel You can change your database’s password by...

How can I change my PHP version on cPanel?

Changing PHP version via cPanel Your Hosting Account's PHP version can be changed at any time,...

How can I create a new MySQL database in cPanel?

Creating a new MySQL database at Servers GATE using cPanel   You can easily create a new MySQL...

How can I locate my MySQL database details on cPanel?

Locating your MySQL database details via cPanel You can easily locate your MySQL databases...

How can I set up a redirect on cPanel?

Creating a redirect on cPanel Your hosting redirects can be easily managed with the assistance...