
The short answer: when a folder or a site opens a box asking for a username and password from the browser itself (not a page of the site), a password protection is active on the server. Error 401 is what appears if you cancel the box or the details are wrong. It is not a fault: it is a protection that is on.
Where the box comes from
| Origin | How to recognise it | What to do |
| cPanel “Directory Privacy” | It was you (or whoever built the site) who protected the folder. | If you still want it, use the details you created; if not, remove the protection: Password protecting a folder. |
| Lines in .htaccess (AuthType Basic, AuthUserFile) | Someone added the rules by hand, or a security plugin did. | Look at the folder’s .htaccess and remove the lines, after keeping a copy. |
| A test or under-construction site | Whoever created it put a password to hide it. | Ask whoever created it for the details, or remove the protection when it is time to open. |
| An API asking for identification | The 401 comes from an API address and not from a page. | Check the request’s key or user: see the API documentation. |
| You filled in the details and it asks again | Wrong username or password, or the browser autofilling old ones. | Type by hand, in a private tab. If you lost the password, create the protection again in cPanel. |
How to remove or change the protection
|
|
|
|
| If the site should be public and the box appears, Google and visitors are shut out: only content in view appears in searches. Check before announcing a new site: Before you publish your website. And a simple password protection does not replace other defences: Keeping your server secure. |
|
Not sure who put the protection on or lost the details? Open a ticket with the folder’s address. Open a support ticket |
|
SEE ALSO Password protecting a folder with Directory Privacy .htaccess for PHP projects: friendly URLs and redirects Before you publish your website: a ten-point launch checklist |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from $5.36/mo (3-year plan, with coupon) See plans |
- 0 Users Found This Useful











