A website folder without a home page can reveal a list of its files to visitors. In cPanel, Indexes can disable Apache directory listing for that folder while leaving normal pages accessible.
No Indexing suppresses the generated file list when no default page, such as index.html or index.php, is present. It does not password-protect files or stop visitors who already know a file's URL.
The setting applies to the directory you select and to subdirectories that inherit its configuration. A subdirectory with its own indexing setting can behave differently, so disabling listings at the website's document root does not override every folder unconditionally.
Steps to disable Apache directory listing in cPanel:
- Open Indexes in the Advanced section of your signed-in cPanel account.
If Indexes is missing, the hosting provider may have disabled the feature.
- Click Edit beside public_html.
public_html is normally the primary website's document root. For another website or an individual subfolder, the target is that site's document root or folder instead; clicking a folder name browses into it.
- Disable directory listing by selecting No Indexing.
Directories used as public file catalogs will no longer show their generated listings. Existing index pages and direct file URLs remain accessible.
- Click Save to apply the setting.
cPanel writes
Options -Indexesto the selected directory's.htaccessfile, creating the file if needed. To undo this choice later, Inherit returns the directory to its parent's setting or the system default. - Reopen Indexes from cPanel's Advanced section.
The save confirmation reports that directory indexing is disabled. Go Back can return to the editor rather than the directory list.
- Confirm that public_html now shows No Indexing under Index Type.
The value in the freshly opened list confirms the saved setting. Inherit or a filename-listing option means the directory is not explicitly set to No Indexing.