How to configure directory indexes in cPanel
This article describes how to use cPanel to define how your web site handles directory listings.
cPanel enables you to specify how directories on your web site are displayed. By default, if an index file is not 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:
- Default System Setting: This option uses the default system setting for your web site. This option is set for all directories by default (unless an .htaccess file exists in a parent directory).
- No Indexing: This option specifies that if an index file is not present, a directory listing is not displayed.
- Standard Indexing (filename only): This option specifies that if an index file is not present, a directory listing is displayed as text.
- Fancy Indexing (filename and description): This option specifies that if an index file is not present, a directory listing is displayed as text with icons.
If any type 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:
- Log in to cPanel.
If you do not know how to log in to your cPanel account, please see this article
- In the ADVANCED section of the cPanel home screen, click Indexes:
- Click the directory name that you want to modify.
- Click the indexing option that you want to set for the directory.
. The new setting takes effect immediately.
- Error pages
You can create custom error pages for your web site to define what a user sees when an error occurs.
- Apache handlers
You can add and delete custom Apache handlers for your web site to specify how certain file types are processed by the server.
- MIME types
You can use cPanel to configure custom MIME types for your web site.