cPanel's installation by default installs and enable
Apache will display the list of files and folders of the directory whenever
DirectoryIndex files are not present.
You can disable
Apache directory listing in
cPanelby following these steps:
Log in to your
section and click on
Select the web directory that you want to disable directory listing on. This is normally
www is just a softlink to
public_html so effectively they're both the same directory
from the option and click on the
What happens in the background is
cPanel will append the following line to the folder's
.htaccess file to disable directory listing.
.htaccess file will be created if it doesn't already exist.
Go back to the directory list and notice the icon on directories with directory listing disabled.