✅ To Turn ON Basic Authentication for a Directory
- Log into cPanel.
- Go to “Directory Privacy” (you can find it under the Files section).
- Navigate to and click on the directory you want to protect (e.g., public_html/ this is the folder to protect 99% of the time, it blocks the whole site).
- On the settings page:
- Check the box “Password protect this directory”.
- Give the protected area a name (any label is fine).
- Click “Save”.
- After saving, click “Go Back”.
- Scroll down and create a user and password that will be required to access the directory.
- Fill in the username and password.
- Click “Save”.
🔐 Now, when someone tries to access that directory via browser, they’ll be prompted to enter the credentials you just created.
❌ To Turn OFF Basic Authentication for a Directory
- Go to “Directory Privacy” in cPanel.
- Navigate to the protected directory.
- Uncheck the box labeled “Password protect this directory”.
- Click “Save”.
👋 This removes the authentication requirement — users can access the directory freely via browser.
