Tip: if you cannot see the .htaccess file in cPanel File Manager, enable Show Hidden Files (dotfiles) in File Manager settings.
To prevent visitors from viewing a directory’s file listing when it has no index page, add this directive to the .htaccess file:
Options -IndexesPlace it in the website’s document root to apply it across the site, or in a subdirectory’s .htaccess file to apply it there. If the file does not exist, create it. This setting requires Apache to allow the Options directive in .htaccess.
