How to Disable Directory Listing in cPanel

September 5, 2023 / cPanel & WHM

Disabling directory listings on your website has many benefits as it helps increase security and privacy. It protects sensitive files such as backups and configurations, ensuring that only authorised users can access them. Furthermore, it gives you better control over the visibility of your website, allowing you to decide which files and directories are accessible to visitors and which remain hidden.

In this article, we will explain two different methods for disabling directory listing in cPanel.

Check out the First Method:

  1. Log into your “cPanel Account.”
    Login to cPanel
  2. Search for the ‘Advanced’ option, and click on the ‘Indexes’ sub-option.
  3. Select the “Directory”, and click on “EDIT.”
    Current Directory
  4. A new window will appear, that will allow you to select the ‘No Indexing’ option to disable the directory listing. You will see four types of indexing methods.
    1. Inhert: This option is configured as the default by the hosting provider.
    2. No Indexing: This option allows you to disable directory listing. The primary purpose behind disabling directory listing is to enhance privacy and reduce the vulnerability of files to potential attacks.
    3. Show Filename Only: Selecting this option will activate the directory listing, allowing users to view the names of the directories.
    4. Show Filename and Description: Enabling this option will activate directory listing, allowing users to view both the names and descriptions of the files and directories within your indexed directory.No Index
  5. Click on “Save.”

Let’s check the second Method:

  1. Log into your “cPanel Account.”
  2. Click ‘File Manager’ from the ‘Files’ Tools.
    File Manager
  3. Select any directory, right-click, and click “Manage Indices.”
  4. Select “No Indexing” option and click on “Save.”
    No Index

In these 2 different ways, you can disable any directory listing in cPanel.

If you want to further enhance your website security, you can also add password protection for the directory in cPanel. This extra step adds another layer of security to your website’s sensitive information.

If you require any additional assistance, please don’t hesitate to reach out to our support department.

Dominos Search