Require a username and password for a folder that should not be publicly browsable.
Before you start
Identify the right document root and keep a copy of any existing directory configuration. Use this only where the hosting service supports it.
What to do
- In cPanel, open Directory Privacy and select the intended directory.
- Enable password protection and create a dedicated user for access.
- Check whether the rule applies to the entire folder and its subfolders before sharing the link.
Check that it worked
In a private window, verify you are challenged on the protected URL and can sign in with the intended account.
If it does not work
Disabling a directory listing alone does not prevent direct access to known files. If you need stronger isolation or access fails unexpectedly, contact support and avoid storing private data under the public web root.