{"id":36848,"date":"2021-09-22T12:03:31","date_gmt":"2021-09-22T12:03:31","guid":{"rendered":"\/tutorials\/?p=36848"},"modified":"2024-10-25T08:40:43","modified_gmt":"2024-10-25T08:40:43","slug":"how-to-fix-the-401-unauthorized-error","status":"publish","type":"post","link":"\/ph\/tutorials\/how-to-fix-the-401-unauthorized-error","title":{"rendered":"401 Error: 7 effective ways to troubleshoot and resolve it"},"content":{"rendered":"<p class=\"wp-block-paragraph\">A &ldquo;401 Unauthorized&rdquo; error page typically occurs for a few reasons:<\/p><ul class=\"wp-block-list\">\n<li><strong>Incorrect authentication credentials<\/strong>. Entering the wrong username or password when trying to access a web page or resource is one of the most common reasons for this error.<\/li>\n\n\n\n<li><strong>Incorrect URL<\/strong>. Ensure you are trying to access the correct URL.<\/li>\n\n\n\n<li><strong>Session timeout<\/strong>. Your session might have expired, especially if you&rsquo;ve been logged in on a page for a long time. Log back in to solve the error.<\/li>\n\n\n\n<li><strong>Misconfigured permissions<\/strong>. The settings on the server might be incorrectly set up, denying access to users who should have it.<\/li>\n\n\n\n<li><strong>Faulty authentication methods<\/strong>. The error can also arise if the server or the resource you&rsquo;re trying to access expects a different authentication method or protocol than what&rsquo;s being provided.<\/li>\n<\/ul><figure tabindex=\"0\" class=\"wp-block-table\"><table><tbody><tr><td><strong>Error code<\/strong><\/td><td>HTTP 401 Unauthorized Error<\/td><\/tr><tr><td><strong>Error type<\/strong><\/td><td>Often a client-side error, but can also be due to server-side configurations<\/td><\/tr><tr><td><strong>Error variations<\/strong><\/td><td>HTTP Error 401 Unauthorized<br>401 Unauthorized Error<br>Error 401 Unauthorized<br>Access Denied<br>401 Authorization Required<\/td><\/tr><tr><td><strong>Error causes<\/strong><\/td><td>Incorrect login credentials (username\/password)<br>Session expiration requiring reauthentication<br>Misconfigured server authentication settings<br>Access Control List (ACL) restrictions<br>Outdated or corrupted browser cache and cookies<br>IP address blocking due to security settings or restrictions<\/td><\/tr><\/tbody><\/table><\/figure><p class=\"has-text-align-center wp-block-paragraph\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/HTTP-Status-Codes-Cheat-Sheet.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">Download comprehensive HTTP status codes cheat sheet<\/a><\/p><p>\n\n\n\n\n\n<div class=\"protip\"><div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                   What is the 401 error code?\n                <\/p>\n            <\/div>\n            <p class=\"protip__content\">The 401 error is an <a href=\"\/ph\/tutorials\/http-status-codes\/\">HTTP status code<\/a> indicating the request sent to the <a href=\"\/ph\/tutorials\/what-is-a-web-server\/\">website&rsquo;s server<\/a> lacks valid authentication credentials. This means that the server understands the request but refuses to authorize it.<\/p><\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-fix-the-401-unauthorized-error\">How to fix the &ldquo;401 Unauthorized&rdquo; error<\/h2><p class=\"wp-block-paragraph\">In this section, we will go over the most common methods to solve 401 error messages.<\/p><p>\n\n\n<div class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <strong>Important!<\/strong> 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.\n            <\/p><\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-1-confirm-the-url-is-correct\">1. Confirm the URL is correct<\/h3><p class=\"wp-block-paragraph\">A wrong URL is a common culprit behind 401 HTTP status codes. Ensure the address is typed correctly in your browser&rsquo;s address bar, especially if it includes special characters or numbers.<\/p><p class=\"wp-block-paragraph\">Typos in hyperlinks from other sites can also lead to this error. If unsure, navigate from the website&rsquo;s homepage or use a search engine to find the correct web pages.<\/p><h3 class=\"wp-block-heading\" id=\"h-2-clear-your-browser-s-cookies-and-cache\">2. Clear your browser&rsquo;s cookies and cache<\/h3><p class=\"wp-block-paragraph\">A corrupted or outdated browser cache and cookies may lead to a server authentication failure. It&rsquo;s also possible that the current cache and cookies are outdated and in need of manual refreshing.<\/p><p class=\"wp-block-paragraph\">To delete the cached data and browser cookies, go to your browser&rsquo;s settings and find the option to clear them. If you use Google Chrome, follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>Click the three-dotted menu icon on the top-right corner.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/03\/image8-2.png\"><img decoding=\"async\" width=\"1024\" height=\"641\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image8-2.png\/public\" alt=\"Three dotted menu icon highlighted in Google Chrome\" class=\"wp-image-106578\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image8-2.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image8-2.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image8-2.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image8-2.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><ol start=\"2\" class=\"wp-block-list\">\n<li>Select<strong> Clear Browsing Data<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/03\/image1-2.png\"><img decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image1-2.png\/public\" alt=\"Clear Browsing Data highlighted in the expanded browser settings\" class=\"wp-image-106579\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image1-2.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image1-2.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image1-2.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image1-2.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>In the <strong>Time range <\/strong>drop-down menu, select <strong>All time<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/03\/image3-3.png\"><img decoding=\"async\" width=\"1024\" height=\"641\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image3-3.png\/public\" alt=\"Time range highlighted in the Clear browsing data pop-up\" class=\"wp-image-106580\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image3-3.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image3-3.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image3-3.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image3-3.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><ol start=\"4\" class=\"wp-block-list\">\n<li>Check <strong>Cookies and other site data <\/strong>and <strong>Cached images and files<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/03\/image6-2.png\"><img decoding=\"async\" width=\"1024\" height=\"1020\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image6-2.png\/w=1024,h=1024,fit=scale-down\" alt=\"Cookies and cached images checkboxes selected and highlighted\" class=\"wp-image-106581\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image6-2.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image6-2.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image6-2.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image6-2.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><ol start=\"5\" class=\"wp-block-list\">\n<li>Select <strong>Clear data.<\/strong><\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/03\/image7-2.png\"><img decoding=\"async\" width=\"1024\" height=\"1020\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image7-2.png\/w=1024,h=1024,fit=scale-down\" alt=\"Clear data button highlighted\" class=\"wp-image-106582\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image7-2.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image7-2.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image7-2.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image7-2.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><p class=\"wp-block-paragraph\">For a detailed guide on how to do this on other browsers, check out our tutorial on <a href=\"\/ph\/tutorials\/clear-browser-cache\/\">how to clear browser cache<\/a>.<\/p><h3 class=\"wp-block-heading\" id=\"h-3-flush-dns-cache\">3. Flush DNS cache<\/h3><p class=\"wp-block-paragraph\">The data in the <a href=\"\/ph\/tutorials\/what-is-dns\/\">domain name system (DNS)<\/a> cache lets your device match URLs to their IP addresses faster for shorter loading times. However, unlike the browser&rsquo;s cache and cookies, the DNS cache operates on the system level.<\/p><p class=\"wp-block-paragraph\">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.<\/p><p class=\"wp-block-paragraph\">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.<\/p><p class=\"wp-block-paragraph\">Follow our guide on <a href=\"\/ph\/tutorials\/how-to-flush-dns\/\">how to flush the DNS cache<\/a> if you&rsquo;re not sure how to do it.<\/p><h3 class=\"wp-block-heading\" id=\"h-4-check-authentication-credentials\">4. Check authentication credentials<\/h3><p class=\"wp-block-paragraph\">The 401 page may appear when you&rsquo;re trying to gain access to restricted resources, such as a password-protected page, with invalid authentication credentials. As a consequence, you won&rsquo;t be able to open the page.<\/p><p class=\"wp-block-paragraph\">Double-check whether you&rsquo;re logged in with a valid user ID and password. If you&rsquo;re sure that you have entered valid authentication credentials, try changing the password.<\/p><p class=\"wp-block-paragraph\">If you&rsquo;re having trouble accessing a password-protected WordPress site, make sure you know <a href=\"\/ph\/tutorials\/change-wordpress-password\/\">how to change your WordPress admin password<\/a>.<\/p><h3 class=\"wp-block-heading\" id=\"h-5-disable-password-protection\">5. Disable password protection<\/h3><p class=\"wp-block-paragraph\">If you&rsquo;re a website owner trying to solve the 401 error, it&rsquo;s worth temporarily disabling password protection for the problematic section of your website.<\/p><p class=\"wp-block-paragraph\">If you have enabled password protection using <strong>.htaccess <\/strong>and <strong>.htpasswd <\/strong>files, follow these steps to disable it:<\/p><ol class=\"wp-block-list\">\n<li>Go to your web hosting account&rsquo;s <strong>File Manager<\/strong>.<\/li>\n\n\n\n<li>Open the password-protected website directory.<\/li>\n<\/ol><p class=\"wp-block-paragraph\">Find the <strong>.htaccess <\/strong>file that you created when you first enabled password protection. Its content should look similar to this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">AuthType Basic\nAuthName \"Your authorization required message.\"\nAuthUserFile \/path\/to\/.htpasswd\nrequire valid-user<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Back up the content of the <strong>.htaccess <\/strong>file in case you want to re-enable password protection in the future.<\/li>\n\n\n\n<li>Delete the <strong>.htaccess <\/strong>file from the directory.<\/li>\n\n\n\n<li>Find the secret location of the <strong>.htpasswd <\/strong>file, back it up, and delete it as well.<\/li>\n<\/ol><p class=\"wp-block-paragraph\"><a href=\"\/ph\/tutorials\/hpanel-tutorial\/\">hPanel<\/a> has a user-friendly feature that lets Hostinger users manage <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1583470-how-can-i-password-protect-my-website\" target=\"_blank\" rel=\"noopener\">password-protected website directories<\/a>.<\/p><p class=\"wp-block-paragraph\">For more information, follow this guide to learn <a href=\"\/ph\/tutorials\/create-default-wordpress-htaccess-file\/\">how to locate and create a WordPress .htaccess file<\/a>.<\/p><h3 class=\"wp-block-heading\" id=\"h-6-check-the-www-authenticate-header\">6. Check the WWW-Authenticate header<\/h3><p class=\"wp-block-paragraph\"><a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc7235#section-4.1\" target=\"_blank\" rel=\"noopener\">According to the IETF<\/a>, a server generating a &ldquo;401 Unauthorized&rdquo; response has to send a WWW-Authenticate header field containing at least one challenge applicable to the target resource.<\/p><p class=\"wp-block-paragraph\">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.<\/p><p class=\"wp-block-paragraph\">To check a WWW-Authenticate header for the cause of the 401 error, follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>Access the page that generates the 401 error code. If you&rsquo;re using Chrome, right-click it and select <strong>Inspect <\/strong>or press <strong>Ctrl+Shift+J<\/strong> to open the developer console.<\/li>\n\n\n\n<li>Open the <strong>Network<\/strong> tab, then reload the page. Click on the entry with the 401 error status.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/12\/inspect-401-error.png\"><img decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/inspect-401-error.png\/w=1024,h=1024,fit=scale-down\" alt=\"How to check a WWW-Authenticate header for the cause of the 401 error.\" class=\"wp-image-41429\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/12\/inspect-401-error.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/12\/inspect-401-error-300x141.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/12\/inspect-401-error-150x70.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/12\/inspect-401-error-768x360.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/12\/inspect-401-error-1536x720.png 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Open the <strong>Headers <\/strong>tab. Find the <strong>WWW-Authenticate<\/strong> entry under the <strong>Response Headers<\/strong> section. It will show the authentication method the server enforces to provide access to the content. <\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/03\/image2-2.png\"><img decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image2-2.png\/w=1024,h=1024,fit=scale-down\" alt=\"WWW-authenticate entry highlighted\" class=\"wp-image-106583\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image2-2.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image2-2.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image2-2.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/03\/image2-2.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol start=\"4\" class=\"wp-block-list\">\n<li>Refer to the <a href=\"https:\/\/www.iana.org\/assignments\/http-authschemes\/http-authschemes.xhtml\" target=\"_blank\" rel=\"noopener\">HTTP Authentication Scheme Registry<\/a> to find out the page&rsquo;s authentication method. In this case, the page uses the basic authentication method, which means that it only requires standard login credentials.<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-7-disable-plugins-modules-and-themes\">7. Disable plugins, modules, and themes<\/h3><p class=\"wp-block-paragraph\">If you get the &ldquo;401 Unauthorized&rdquo; error as the website&rsquo;s administrator, you can try to identify its cause by disabling the plugins, modules, and themes you have installed on your website.<\/p><p class=\"wp-block-paragraph\">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.<\/p><p class=\"wp-block-paragraph\">To <a href=\"\/ph\/tutorials\/change-a-theme-in-wordpress\/\">change back to the default theme<\/a>, go to <strong>Appearance &rarr; Themes<\/strong> and <strong>Activate <\/strong>the default theme.<\/p><p class=\"wp-block-paragraph\">To disable all <a href=\"\/ph\/tutorials\/what-is-wordpress-plugin\/\">WordPress plugins<\/a> at the same time, go to <strong>Plugins &rarr; Installed Plugins<\/strong>. Bulk-select all the plugins, choose <strong>Deactivate <\/strong>from the drop-down menu, and click <strong>Apply<\/strong>.<\/p><p class=\"wp-block-paragraph\">The process to change your design template and disable the modules should be similar to any other CMS dashboard.<\/p><p class=\"wp-block-paragraph\">If you don&rsquo;t have access to your WordPress admin dashboard, you can<a href=\"https:\/\/support.hostinger.com\/en\/articles\/4411258-how-to-disable-wordpress-plugins-without-access-to-the-admin-page\" target=\"_blank\" rel=\"noopener\"> disable your WordPress plugins<\/a> by opening the File Manager on your hosting account and renaming the <strong>Plugins<\/strong> folder. Hostinger users can manage their plugins straight from hPanel.<\/p><p class=\"wp-block-paragraph\">Similarly, you can<a href=\"https:\/\/support.hostinger.com\/en\/articles\/4469298-how-to-change-wordpress-theme-via-phpmyadmin\" target=\"_blank\" rel=\"noopener\"> change your WordPress theme<\/a> without opening the admin dashboard by making changes to files through File Manager and phpMyAdmin.<\/p><h2 class=\"wp-block-heading\" id=\"h-401-error-variations\">401 Error Variations<\/h2><p class=\"wp-block-paragraph\">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&rsquo;re experiencing.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/12\/401-error.png\"><img decoding=\"async\" width=\"1919\" height=\"433\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/401-error.png\/w=1024,h=1024,fit=scale-down\" alt=\"Example of 401 error.\" class=\"wp-image-41423\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/12\/401-error.png 1919w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/12\/401-error-300x68.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/12\/401-error-1024x231.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/12\/401-error-150x34.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/12\/401-error-768x173.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2021\/12\/401-error-1536x347.png 1536w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/a><\/figure>\n<\/div><p class=\"wp-block-paragraph\">Commonly seen messages include:<\/p><ul class=\"wp-block-list\">\n<li>HTTP Error 401<\/li>\n\n\n\n<li>401 Authorization Required<\/li>\n\n\n\n<li>401 Unauthorized Error<\/li>\n\n\n\n<li>Access Denied<\/li>\n\n\n\n<li>Unauthorized<\/li>\n<\/ul><p class=\"wp-block-paragraph\">Each variation of the 401 error provides insights into why the authentication process failed, aiding in diagnosing and resolving access issues.<\/p><p class=\"wp-block-paragraph\">Below is a detailed list of various 401 error codes, along with their specific meanings:<\/p><ul class=\"wp-block-list\">\n<li><strong>401.1<\/strong>. The login attempt has failed, usually due to incorrect authentication credentials being provided.<\/li>\n\n\n\n<li><strong>401.2<\/strong>. The login attempt has been obstructed by server configuration issues, preventing successful authentication.<\/li>\n\n\n\n<li><strong>401.3<\/strong>. Access is denied due to the access control list (ACL) settings, which restrict resource access based on user permissions.<\/li>\n\n\n\n<li><strong>401.501<\/strong>. Too many requests have been generated by the client, or the client has reached the maximum request limit.<\/li>\n\n\n\n<li><strong>401.502<\/strong>. This error occurs when a particular client (same IP) sends multiple requests to a single server, reaching the dynamic IP Restriction Concurrent request rate limit.<\/li>\n\n\n\n<li><strong>401.503<\/strong>. The client&rsquo;s <a href=\"\/ph\/tutorials\/what-is-ip-address\/\">IP address<\/a> is included in the server&rsquo;s deny list.<\/li>\n\n\n\n<li><strong>401.504<\/strong>. The client&rsquo;s hostname is included in the server&rsquo;s deny list.<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p class=\"wp-block-paragraph\">The HTTP error 401 occurs when the browser&rsquo;s request to the server lacks valid authentication credentials. While it&rsquo;s most commonly caused by a client-side issue that is easy to fix, it can also stem from a server error.<\/p><p class=\"wp-block-paragraph\">In this guide, we&rsquo;ve gone over the most common methods to solve the 401 error:<\/p><ol class=\"wp-block-list\">\n<li><strong>Confirm the URL is correct<\/strong>.<strong> <\/strong>Double-check the URL in case it&rsquo;s misspelled or outdated.<\/li>\n\n\n\n<li><strong>Clear cache<\/strong>.<strong> <\/strong>Clear the browser&rsquo;s cache and cookies for a possible solution. If that fails, try flushing your DNS cache.<\/li>\n\n\n\n<li><strong>Check authentication credentials<\/strong>. Make sure you&rsquo;ve entered a valid username and password. If the issue persists, try resetting the password.<\/li>\n\n\n\n<li><strong>Disable password protection<\/strong>. If you experience this issue as the website administrator, try temporarily disabling the problematic section&rsquo;s password protection by deleting the <strong>.htaccess <\/strong>and .<strong>htpasswd <\/strong>files.<\/li>\n\n\n\n<li><strong>Troubleshoot the code<\/strong>.<strong> <\/strong>Check the WWW-Authenticate header and try disabling problematic plugins, modules, or themes.<\/li>\n<\/ol><p class=\"wp-block-paragraph\">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.<\/p><h2 class=\"wp-block-heading\" id=\"h-401-error-message-faq\">401 Error Message FAQ<\/h2><p class=\"wp-block-paragraph\">Find answers to the most frequently asked questions about the 401 error message below.<\/p><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1664962261618\"><h3 class=\"schema-faq-question\">Why do I get a 401 HTTP error?<\/h3> <p class=\"schema-faq-answer\">A 401 error occurs when you try to access a page that requires valid authentication credentials, but your current ones aren&rsquo;t recognized or are missing. To resolve this, contact the page administrator to obtain the correct access details.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1690193046386\"><h3 class=\"schema-faq-question\">How does a 401 error affect my ability to access a website?<\/h3> <p class=\"schema-faq-answer\">A 401 error temporarily blocks access to a specific page or resource until you provide valid login credentials. It doesn&rsquo;t affect your ability to access other parts of the website that don&rsquo;t require authentication.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1711569181955\"><h3 class=\"schema-faq-question\">What is the difference between a 401 error and a 403 error?<\/h3> <p class=\"schema-faq-answer\">While a 401 error means unauthorized access due to invalid or missing credentials, a <a href=\"\/ph\/tutorials\/what-is-403-forbidden-error-and-how-to-fix-it\/\">403 error<\/a> indicates you&rsquo;re forbidden from accessing the page, even with valid credentials, often due to permissions set by the website administrator.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>A &ldquo;401 Unauthorized&rdquo; 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 Unauthorized401 Unauthorized ErrorError 401 UnauthorizedAccess Denied401 Authorization Required Error causes Incorrect login credentials (username\/password)Session expiration requiring reauthenticationMisconfigured server authentication [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ph\/tutorials\/how-to-fix-the-401-unauthorized-error\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":186,"featured_media":106576,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Fix 401 Error Quickly With 7 Effective Methods","rank_math_description":"The 401 Unauthorized error is triggered by unauthenticated requests made to a WordPress web server. Learn how to identify and fix the issue.","rank_math_focus_keyword":"401 error","footnotes":""},"categories":[22623,22625],"tags":[],"class_list":["post-36848","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hosting","category-technical-aspects"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-fix-the-401-unauthorized-error\/","default":1},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/erro-401\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/comment-reparer-l-erreur-401\/","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/error-401\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/error-401-unauthorized\/","default":0},{"locale":"de-DE","link":"https:\/\/www.hostinger.com\/de\/tutorials\/401-unauthorized-fehler-beheben\/","default":0},{"locale":"it-IT","link":"https:\/\/www.hostinger.com\/it\/tutorial\/come-risolvere-errore-401-unauthorized\/","default":0},{"locale":"nl-NL","link":"https:\/\/www.hostinger.com\/nl\/tutorials\/401-error\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-fix-the-401-unauthorized-error\/","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-fix-the-401-unauthorized-error\/","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-fix-the-401-unauthorized-error\/","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-fix-the-401-unauthorized-error\/","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-fix-the-401-unauthorized-error\/","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-fix-the-401-unauthorized-error\/","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-fix-the-401-unauthorized-error\/","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/error-401\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/error-401\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/error-401\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/erro-401\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/36848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/users\/186"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/comments?post=36848"}],"version-history":[{"count":56,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/36848\/revisions"}],"predecessor-version":[{"id":117929,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/36848\/revisions\/117929"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/media\/106576"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/media?parent=36848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/categories?post=36848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/tags?post=36848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}