By default cPanel will show the contents of a web folder if there is no default web page.
This is called directory browsing.
You can turn this feature off by following these steps:
- Log in to your cPanel account and scroll down to the Advanced section and click on Indexes
- Click the Edit button next to the directory you want to disable the browsing on. In most cases this would be public_html to turn off browsing for all public folders.
- Set to No Indexing and click on Save