How to disable directory indexes server wide – cPanel/WHM

Is there a simple way to disable directory index?

Sure!! Let us start with “What is “directory index?” This is simply a feature that allows to view all files in a directory via a directory index when there is no index file in that directory. In cPanel/WHM server this feature is enabled by-default.

This is also easy to manage this feature if we have the control panel like cPanel. We can improve the server security by disabling this feature globally. This can be done via server commandline or from the WHM panel.

We already discussed the steps to disable directory index from the server command line for non cPanel server which has Apache web server installed.

You can check our previous article; Steps to disable ‘Directory listing’ in Apache web server.

Here I explaining the steps to disable this via WHM panel, it’s really simple.

Step I : Log into WHM as root.

Step II : Go to Apache Configuration.

Home » Service Configuration » Apache Configuration


Step III : Click on Global Configuration.

Step IV : Move to Directory “/” Options.


Step V : Uncheck Indexes.

Step VI : Save then Rebuild Configuration and Restart Apache.

That’s it!!

Disabling directory index / directory listing for a particular cPanel account.

This option is also available on individual cPanel accounts. The main advantage is, we can keep this feature enabled on the server and can easily disable for particular domains or accounts on the server.

Here I’m explaining the steps to manage this feature via individual cPanel.

1. Login to your cPanel.
2. Go to Index Manager (In search box type index manager).
3. The directory list will be shown down. Select the directory you want to turn off directory listing.
4. Select No Indexing and click save.
5. The directory listing will be disabled now.



Arunlal Ashok

DevOps (Server & Cloud infrastructure) Engineer. I'm managing Linux servers since 2012. I started this blog to share and discuss my ideas. Any questions? Write to arun (@)

You may also like...

4 Responses

  1. Cornélio José Wiedemann says:

    Hello boy
    very tks
    this post big help

    apologize my bad inglish

    Cornélio José Wiedemann ( TI & DBA )

  2. vivesk says:

    Thanks for sharing these useful tips. Learning lot of things from you

Leave a Reply

Your email address will not be published. Required fields are marked *