Use cPanel’s Directory Privacy feature to require a username and password before visitors can access a folder.
- Log in to cPanel.
- In the Files section, click Directory Privacy.
- Click the folder icons to navigate to the directory you want to protect, then click the directory name.
- Under Security Settings, select Password protect this directory. Enter a name for the protected directory, then click Save.
- Click Go Back.
- Under Create User, enter a username and password, or use the password generator. Save the credentials somewhere secure, then create the user.
When you visit the folder’s URL in a browser, such as www.example.com/myfolder, the browser will prompt you for the username and password.
