How to Disable Directory Indexing in Apache via WHM
Directory indexing can be a security risk, as it allows users to list files inside a directory when no index file (e.g., index.html) is present. You can disable this option directly from WHM.
Steps to Disable the "Indexes" Option
- Log in to WHM with root privileges.
- In the top-left search bar, type "Apache Configuration" and click on Apache Configuration.
- Select Global Configuration.
- Scroll down to the section Directory ‘/’ Options.
- Uncheck the Indexes checkbox.
- Scroll down and click Save to apply the changes.
- WHM will prompt you to restart Apache: confirm to apply the new configuration.
Note
This change applies to the root directory and can be inherited by all subdirectories unless overridden by a custom directive in a .htaccess file.