maxAllowedContentLength
- Default
- 30000000 bytes, about 28.6 MB
- Sub-status
- 404.13
Fix an IIS 404 Not Found: read the sub-status (404.0 to 404.20), then check the file, site binding, handler mapping, MIME type, request filtering and size limits.
In IIS, a 404 Not Found carries a sub-status that separates a missing file (404.0) from a missing site (404.1), handler (404.4), MIME mapping (404.3) or a request filtering rule (such as 404.5, 404.14 or 404.19). Read the sub-status in the IIS log first, because many IIS 404s mean a rule blocked the request, not that the file is gone.
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.
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.
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.
The sub-status is recorded in the IIS log as HttpSubStatus, one of the default log fields. The default log directory is %SystemDrive%\inetpub\logs\LogFiles. For a quick look at the details, request the page from the server itself: httpErrors defaults to errorMode="DetailedLocalOnly", so only local requests get the detailed error.
| Sub-status | Meaning | What to check |
|---|---|---|
| 404.0 | File or directory not found, moved or does not exist | The path, spelling and virtual directory mapping |
| 404.1 | Site not found | That the requested website exists on this server |
| 404.2 | ISAPI or CGI restriction | Whether the ISAPI or CGI resource is restricted on the server |
| 404.3 | MIME type restriction | The MIME mapping for the file extension is invalid or not set |
| 404.4 | No handler configured | No handler maps the file name extension of the URL |
| 404.5 | Denied by request filtering configuration | The URL contains a blocked character sequence |
| 404.6 / 404.7 | Verb denied / file extension denied | The HTTP verb or extension is not allowed |
| 404.8 / 404.9 | Hidden namespace / hidden file attribute | A hidden segment or a file with the hidden attribute |
| 404.10, 404.14, 404.15 | Header, URL or query string too long | Request limits for headers, maxUrl and maxQueryString |
| 404.11 / 404.12 | Double escape sequence / high-bit characters | The URL contains them and the server is set to refuse |
| 404.13 | Content length too large | maxAllowedContentLength |
| 404.17 | Dynamic content mapped to the static file handler | The handler mapping for the file type |
| 404.18 / 404.19 / 404.20 | Query string sequence denied / denied by filtering rule / too many URL segments | The request filtering rules and limits for the site |
maxAllowedContentLengthmaxUrlmaxQueryString<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="104857600" /> <!-- 100 MB, in bytes -->
</requestFiltering>
</security>
</system.webServer>
</configuration>For the plain 404.0 case, Microsoft's checklist is short: confirm the file in the URL exists and sits in the right place, and if the site uses a virtual directory, confirm it points to the folder that holds the file. Common causes include files that were renamed, moved or deleted, and a virtual directory that is mapped to the root of a drive on another server. For static files, a missing MIME mapping gives 404.3. Hidden files give 404.9, so check the file's hidden attribute.
Google does not index URLs that return a 4xx status and removes indexed ones that start returning it; see 4xx errors.
Open the newest file in the log directory (by default %SystemDrive%\inetpub\logs\LogFiles) and read the status and sub-status for the URL.
Use the tables above, then repeat the request.
If you added a custom 404 page, it must still send a 404 status code; see soft 404 errors.
4 questions people ask next, answered from the sources on this page.
Read the sub-status in the IIS log. For 404.0, confirm the file exists in the right folder and virtual directory. For 404.1 to 404.20, fix the site, handler, MIME mapping or request filtering rule the sub-status points to.
"Content length too large": the request's Content-Length header is larger than the server allows. The maxAllowedContentLength default is 30000000 bytes, about 28.6 MB.
"MIME type restriction": the MIME mapping for the requested extension is invalid or not set. Add the extension to the MIME map for the site.
A rule can refuse the request with a 404 sub-status: request filtering, a hidden file or segment, a missing handler, a size limit or an IP deny rule that uses NotFound.
Run the free audit, then approve the fixes. Every change can be undone.