Hosting and cPanel

Control directory file listings in cPanel

Reviewed on 1 min read directorios indices

The Indexes tool decides what the server shows when someone opens a web folder that has no entry file, such as index.html or index.php. It doesn't control Google indexing.

Choose the setting

In cPanel > Indexes, find the directory and open its settings:

  • Inherit uses the option of the parent directory or the server default.
  • No Indexing stops the file listing from being shown.
  • Show Filename Only (standard indexing) shows the names of the accessible files.
  • Show Filename and Description (fancy indexing) adds information such as size or type.

Save and test the folder's URL. The option is inherited by subdirectories that don't have their own setting. If the application or its .htaccess handles that path, the result will also depend on its rules.

What it protects and what it doesn't

For a folder whose content shouldn't be listed, use No Indexing. It's normal for an error, usually 403, to appear when it's opened without an entry file.

Hiding the listing doesn't stop a file from being downloaded if someone knows its address. Private documents should be outside the public root or protected with proper access control; a hard-to-guess name isn't enough.

If you wanted a website's home page to show, check its entry file and the domain's document root instead of turning on the listing. To go back to the previous behaviour, select the option that directory had before.

You may also find useful

Something wrong or out of date? Tell us and we will review it.