Issue
An error message 401 - Unauthorized is appearing when visiting part of your site.
Solution
This generic notification is only displayed if Directory Privacy has been enabled on the path containing the page where the error message occurred. The message results when an invalid user name/password combination is supplied in the password prompt to access the page. Directory Privacy (a.k.a. password protection) can be applied to an entire site, a subdomain, or a specific folder path. (Learn More)
To resolve the issue:
- Only password protect the folders and files as required for your site's and your users' security. If a folder path does not need to be password protected, use the Directory Privacy tool to turn off the password protection.
- Verify that the users have the correct user name/password combination for the folder path. Reminder: The username/password combos are set for each password protected folder path separately. The same username may be set up to access multiple folder paths, but with separate passwords. This could lead to a visitor using the wrong password for the page they are trying to visit.
If you have visitors who are attempting to access a path that they are not authorized for, and would like to customize the messaging they are receiving, cPanel does allow for custom error message pages. In the Error Pages tool, configure a custom 401 (Authorization Required) page. This custom page could include both information on why access to the page is restricted, as well as contact information for requesting access.