How to Disable Directory Browsing and File Listing with cPanel Indexes

63 views
Short answer: Open cPanel Indexes, select your web root directory, and set indexing policy to 'No Indexing' to prevent public directory browsing of your site files.

Prevent unauthorized directory file browsing for folders lacking default index pages to shield code assets and confidential media.

Quick reference

Tool Location cPanel > Advanced > Indexes
Recommended Mode No Indexing (Yields 403 Forbidden)
Equivalent .htaccess directive Options -Indexes
Critical Targets public_html, upload directories, asset libraries

Steps

  1. Open Index Manager: In the Advanced section of cPanel, click Indexes.
  2. Navigate Directory Tree: Click folder icons to drill down to public_html or target subfolders.
  3. Edit Folder Display: Click Edit in the Actions column alongside the desired directory.
  4. Enforce No Indexing: Select No Indexing and click Save.

Troubleshooting and tips

  • Expected 403 Forbidden Behavior: Navigating directly to a folder URL that lacks an index.html or index.php will correctly return an HTTP 403 response, confirming directory listing is actively blocked.
Need more help? If you run into an error while following these steps, open a ticket with technical support and our team will look into it. Open a ticket
Was this article helpful?
No, I need more help
Didn't find your answer?
Under 3 minutes
Submit Support Ticket