Oct 25, 2024
Hasna A. & Matleena S.
6min Read
A “401 Unauthorized” error page typically occurs for a few reasons:
| Error code | HTTP 401 Unauthorized Error |
| Error type | Often a client-side error, but can also be due to server-side configurations |
| Error variations | HTTP Error 401 Unauthorized 401 Unauthorized Error Error 401 Unauthorized Access Denied 401 Authorization Required |
| Error causes | Incorrect login credentials (username/password) Session expiration requiring reauthentication Misconfigured server authentication settings Access Control List (ACL) restrictions Outdated or corrupted browser cache and cookies IP address blocking due to security settings or restrictions |
Download comprehensive HTTP status codes cheat sheet
The 401 error is an HTTP status code indicating the request sent to the website’s server lacks valid authentication credentials. This means that the server understands the request but refuses to authorize it.
In this section, we will go over the most common methods to solve 401 error messages.
Important! Before you proceed with any of the methods, check whether the website is down for everyone or just you. This will help determine whether the issue is local or server-side.
A wrong URL is a common culprit behind 401 HTTP status codes. Ensure the address is typed correctly in your browser’s address bar, especially if it includes special characters or numbers.
Typos in hyperlinks from other sites can also lead to this error. If unsure, navigate from the website’s homepage or use a search engine to find the correct web pages.
A corrupted or outdated browser cache and cookies may lead to a server authentication failure. It’s also possible that the current cache and cookies are outdated and in need of manual refreshing.
To delete the cached data and browser cookies, go to your browser’s settings and find the option to clear them. If you use Google Chrome, follow these steps:
For a detailed guide on how to do this on other browsers, check out our tutorial on how to clear browser cache.
The data in the domain name system (DNS) cache lets your device match URLs to their IP addresses faster for shorter loading times. However, unlike the browser’s cache and cookies, the DNS cache operates on the system level.
Although rare, a DNS error may result in the 401 HTTP status code. The cache may be outdated and contain incorrect URL and IP address details.
Flushing your DNS will clear the existing DNS records of your device. Thsi will force it to make a completely new request and re-authenticate the URLs.
Follow our guide on how to flush the DNS cache if you’re not sure how to do it.
The 401 page may appear when you’re trying to gain access to restricted resources, such as a password-protected page, with invalid authentication credentials. As a consequence, you won’t be able to open the page.
Double-check whether you’re logged in with a valid user ID and password. If you’re sure that you have entered valid authentication credentials, try changing the password.
If you’re having trouble accessing a password-protected WordPress site, make sure you know how to change your WordPress admin password.
If you’re a website owner trying to solve the 401 error, it’s worth temporarily disabling password protection for the problematic section of your website.
If you have enabled password protection using .htaccess and .htpasswd files, follow these steps to disable it:
Find the .htaccess file that you created when you first enabled password protection. Its content should look similar to this:
AuthType Basic AuthName "Your authorization required message." AuthUserFile /path/to/.htpasswd require valid-user
hPanel has a user-friendly feature that lets Hostinger users manage password-protected website directories.
For more information, follow this guide to learn how to locate and create a WordPress .htaccess file.
According to the IETF, a server generating a “401 Unauthorized” response has to send a WWW-Authenticate header field containing at least one challenge applicable to the target resource.
This response header determines the authentication method the web browser should follow to access a specific page. Knowing what response the header sends and which authentication method is used will help determine the problem.
To check a WWW-Authenticate header for the cause of the 401 error, follow these steps:

If you get the “401 Unauthorized” error as the website’s administrator, you can try to identify its cause by disabling the plugins, modules, and themes you have installed on your website.
For example, if you have a WordPress site and can access its admin dashboard, consider changing your theme to the default and disabling all your plugins.
To change back to the default theme, go to Appearance → Themes and Activate the default theme.
To disable all WordPress plugins at the same time, go to Plugins → Installed Plugins. Bulk-select all the plugins, choose Deactivate from the drop-down menu, and click Apply.
The process to change your design template and disable the modules should be similar to any other CMS dashboard.
If you don’t have access to your WordPress admin dashboard, you can disable your WordPress plugins by opening the File Manager on your hosting account and renaming the Plugins folder. Hostinger users can manage their plugins straight from hPanel.
Similarly, you can change your WordPress theme without opening the admin dashboard by making changes to files through File Manager and phpMyAdmin.
When encountering a 401 response, instead of reaching the intended web page, your browser will display an error message. These messages serve as indicators of the specific type of 401 error you’re experiencing.
Commonly seen messages include:
Each variation of the 401 error provides insights into why the authentication process failed, aiding in diagnosing and resolving access issues.
Below is a detailed list of various 401 error codes, along with their specific meanings:
The HTTP error 401 occurs when the browser’s request to the server lacks valid authentication credentials. While it’s most commonly caused by a client-side issue that is easy to fix, it can also stem from a server error.
In this guide, we’ve gone over the most common methods to solve the 401 error:
We hope that the information in this article has helped you fix the 401 error. If you have any questions or tips, feel free to leave us a comment in the section below.
Find answers to the most frequently asked questions about the 401 error message below.
A 401 error occurs when you try to access a page that requires valid authentication credentials, but your current ones aren’t recognized or are missing. To resolve this, contact the page administrator to obtain the correct access details.
A 401 error temporarily blocks access to a specific page or resource until you provide valid login credentials. It doesn’t affect your ability to access other parts of the website that don’t require authentication.
While a 401 error means unauthorized access due to invalid or missing credentials, a 403 error indicates you’re forbidden from accessing the page, even with valid credentials, often due to permissions set by the website administrator.
All of the tutorial content on this website is subject to Hostinger's rigorous editorial standards and values.