401 Unauthorized in IIS
Read the IIS 401 sub-status (401.1 to 401.5, 401.501 to 401.504) and fix the cause: authentication methods, NTFS ACLs, filters, IP restrictions.
IIS splits 401 into sub-status codes. 401.1 is a failed logon, 401.2 a server authentication configuration problem, 401.3 an NTFS ACL denial, 401.4 and 401.5 an ISAPI filter or CGI application, and 401.501 to 401.504 the IP restriction features. The sub-status tells you which fix applies.
Where does your site stand?
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
- Free audit in 60 seconds
- Fixes drafted for your review
- ChatGPT, Perplexity, Gemini and AI Overviews tracked
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
- Re-check after big site changes
- Keep this page for reference
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
- Follow the steps below
- Top-traffic pages first
- Check again in a month
Read the sub-status before changing anything
Microsoft's IIS status code reference lists the following 401 sub-status codes. One 401 can mean a wrong password, a missing authentication module or a file permission, and the sub-status is the quickest way to tell them apart.
| Code | Microsoft's label | First check |
|---|---|---|
| 401.1 | Logon failed | User name or password; whether the account exists |
| 401.2 | Logon failed due to server configuration | Authentication settings: is any enabled method one the client can use? |
| 401.3 | Unauthorized due to ACL on resource | NTFS permissions on the file and its folder |
| 401.4 | Authorization failed by filter | ISAPI filters installed on the site |
| 401.5 | Authorization failed by ISAPI/CGI application | The ISAPI or CGI application's own authorization |
| 401.501 | Concurrent request rate limit reached | Dynamic IP Restriction concurrent-request setting |
| 401.502 | Maximum request rate limit reached | Dynamic IP Restriction request-rate setting |
| 401.503 | IP address denied | IP Restriction deny list |
| 401.504 | Host name denied | IP Restriction deny list by host name |
The reference says these specific codes are displayed in the client browser but not in the IIS log. By default IIS shows detailed error information only to a browser on the local server and a generic message to everyone else, because errorMode defaults to DetailedLocalOnly. So request the page from the server itself to see the sub-status, or set errorMode to Detailed temporarily while debugging.
Authentication methods: the usual 401.2
The same change from the command line, which Microsoft's page shows with /commit:apphost:
appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"False" /commit:apphost
appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/windowsAuthentication /enabled:"True" /commit:apphost<location path="Contoso">
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<basicAuthentication enabled="true" defaultLogonDomain="Contoso" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
</location>Reproduce and check it in 2 minutes
curl -s -D - -o /dev/null https://httpbin.org/status/401
# Expect: HTTP/2 401 and a www-authenticate: Basic realm="Fake Realm" headercurl -s -D - -o /dev/null https://intranet.example.test/ | grep -i www-authenticate
# With Windows authentication on, the default provider list from the docs is
# Negotiate then NTLM, so expect those schemes in the header.Invoke-WebRequest -Uri https://intranet.example.test/ -UseDefaultCredentials | Select-Object StatusCode
# Expect: 200. A 401.1 here points at the account, a 401.3 at NTFS permissions.On your own IIS site, the challenge header tells you which methods are enabled. This needs your host name:
Windows authentication specifics
Negotiate then NTLM. The docs say it suits intranets because Kerberos needs a connection to Active Directory and NTLM does not work through HTTP proxy connections.useKernelMode defaults to true. Microsoft's best practice is to leave it on if you use Kerberos with a custom application pool identity, since kernel-mode authentication can prevent authentication problems with such pools. If a Kerberos login works for the default identity and fails for a custom one, check that setting before touching SPNs.
<windowsAuthentication enabled="false">
<providers>
<add value="Negotiate" />
<add value="NTLM" />
</providers>
</windowsAuthentication>What it means for SEO and crawlers
Every fact, linked and dated.
microsoft.com
google.com
- 01HTTP status code overview - Internet Information Services (Microsoft Learn)learn.microsoft.com · checked 2026-11-01
- 02Security Authentication <authentication> (Microsoft Learn)learn.microsoft.com · checked 2026-11-01
- 03Windows Authentication <windowsAuthentication> (Microsoft Learn)learn.microsoft.com · checked 2026-11-01
- 04HTTP Errors <httpErrors> (Microsoft Learn)learn.microsoft.com · checked 2026-11-01
- 05How HTTP status codes affect Google's crawlersdevelopers.google.com · checked 2026-11-01
Asked a lot.
2 questions people ask next, answered from the sources on this page.
01What is the difference between 401.1 and 401.3 in IIS?
401.1 means the logon failed, probably a bad user name or password. 401.3 means NTFS permissions on the resource denied an identity that did log on.
02Why do I see a 401 once before the login succeeds?
The first request carries no credentials, so IIS answers with a 401 and the authentication challenge. The client then retries with credentials.
Tools point. Agencies advise. This one ships.
Run the free audit, then approve the fixes. Every change can be undone.
- 46 fixes shipped without a ticket Brightpipe
- 0→7 ChatGPT citations in six weeks Paylane