Skip to main content
When someone visits a URL that points to a directory rather than a specific file, the server looks for an index page (index.html, index.php, etc.). If no index page exists, the server may display a list of every file in that directory. The Indexes tool in cPanel lets you control this behaviour per directory.

Why this matters

A visible file listing can expose files you didn’t intend to be public — backup archives, configuration files, or uploads that aren’t linked from your site. Disabling directory indexes is a simple way to reduce this risk.

Configure directory indexes

1

Open Indexes

Log in to cPanel through your client area or at yourdomain.com/cpanel. Go to Advanced and click Indexes.
2

Navigate to the directory

Browse to the folder you want to configure. Click a folder name to open it, or click Up One Level to go back.
3

Choose an index setting

Click Edit next to the directory and select one of the following options:
  • Inherit — use the parent directory’s setting. If no parent setting exists, the server default applies.
  • No Indexing — visitors see a “403 Forbidden” error instead of a file listing.
  • Show Filename Only — display a plain list of file names.
  • Show Filename and Description — display file names along with size and type information.
Click Save.
Set public_html to No Indexing and let it inherit down to all subdirectories. You can then override individual directories if you actually want a file listing somewhere.
You can also disable directory indexes by adding Options -Indexes to an .htaccess file in the relevant directory. The cPanel Indexes tool does the same thing through a visual interface.