This adds a simple browser login box. It’s good for keeping a test site or private files away from the public, but it isn’t a member login system. For WordPress member areas, use a WordPress plugin instead.
Lock the folder
1
Open Directory Privacy
Log in to cPanel, type Directory Privacy in the Search Tools box and open it.
2
Find the folder
Your website files are in
public_html. Click folder names to open them until you see the folder you want to lock, then click Edit next to it.3
Turn on protection
Tick Password protect this directory. Type a name for the protected area, such as
Private area. Visitors see it in the login box. Click Save.4
Create a user
On the same page, enter a username and a strong password, then save the user. Share these with the people who need access.
Remove access or protection
- Remove one person: open the folder in Directory Privacy again and delete their user.
- Unlock the folder: untick Password protect this directory and save.