Introduction
The Indexes feature in cPanel lets you control how directories on your website are displayed when no default file (like index.html
or index.php
) is present. This is useful for managing directory browsing behavior, either by hiding file listings or customizing how they appear to visitors.
This article explains how to configure index settings for any directory in your website.
Why Use Indexes?
By default, if someone visits a directory without an index file, the server may show a list of all files inside that folder. This could reveal sensitive files or scripts. The Indexes tool allows you to:
-
Enable or disable directory listing
-
Customize how listings are displayed
-
Improve security by hiding file structures from visitors
How to Access Indexes in cPanel
-
Log in to your cPanel account
-
Scroll to the Advanced section
-
Click on Indexes
How to Configure Indexing for a Directory
-
Navigate through your file structure to select a folder
-
Click on the directory name to manage its index settings
-
Choose one of the following options:
-
Default System Setting – Uses server’s global setting
-
No Indexing – Prevents file listing (shows 403 Forbidden)
-
Standard Indexing (Filename only) – Displays file names in a plain list
-
Fancy Indexing (Filename and description) – Displays file names, sizes, and modification dates
-
-
Click Save
The selected indexing setting will be applied immediately.
Example Use Case
Let’s say you have a directory:https://example.com/files/
-
If there is no index.html, visitors may see all files listed
-
To prevent this, set the folder to No Indexing using the Indexes tool
-
This will return a 403 error instead of exposing files
Best Practices
-
Always use No Indexing on sensitive directories (e.g.,
/config/
,/includes/
) -
Use Fancy Indexing for public file repositories or download sections
-
Place an
index.html
placeholder to override listing behavior if needed -
Combine with .htaccess for advanced control if you're experienced
Conclusion
The Indexes tool in cPanel helps you protect or manage how your site's directories are displayed to visitors. Whether you're looking to prevent access, display organized file lists, or just enforce a cleaner user experience, this feature gives you simple but effective control over your folder visibility.