How to Hide Website Directory Contents with Index Manager in cPanel Print

  • 0

If visitors land on a directory (a folder) of your website that does not contain an index file (like index.html, index.php, etc.), the web server will typically display a list of all files in that directory. This is a significant security risk as it can reveal the structure and private files of your website.

Index Manager Steps:

  1. Log into your cPanel dashboard.
  2. Scroll down to the Advanced section and click the Indexes icon.
  3. Select the directory you wish to protect by clicking on its name (e.g., the clients directory or the root directory /public_html).

Set Indexing Options

Under Set Indexing for..., you will see four options:

  • Default System Setting: (Allows directory contents to be shown - SECURITY RISK).
  • No Indexing: (Recommended) Prevents the contents of the directory from being shown in a web browser. Visitors will see an "Access Forbidden" error instead of a file list.
  • Standard Indexing: Prevents viewing for directories without image files.
  • Fancy Indexing: Prevents viewing for directories with image files.

Final Step

  1. Select No Indexing and click Save.

The directory settings are instantly updated. Visitors will no longer be able to browse the contents of that folder, significantly improving your website's security.

Note: While No Indexing is the recommended setting, you can also achieve the same result by placing a blank file named .htaccess inside the directory and adding the single line: Options -Indexes.


Was this answer helpful?

« Back