TrueURL

412 Precondition Failed

A condition in the request headers, such as If-Match or If-Unmodified-Since, was false, so the server did not apply the change.

Reason phrase
Precondition Failed
Redirect
No
Cacheable by default
No

412 Precondition Failed means that one or more conditions in the request headers evaluated to false. It is the result of a failed If-Match or If-Unmodified-Since, or of a failed If-None-Match on methods other than GET and HEAD. The server did not perform the requested action.

Its main purpose is to prevent lost updates (optimistic concurrency control). A client reads a resource with its ETag, edits it and sends the change with If-Match and that ETag. If someone else changed the resource in the meantime, the ETag no longer matches, and the server answers 412 instead of overwriting the other change. It is also used with If-None-Match: * to create a resource only if it does not exist yet.

For GET and HEAD, a false If-None-Match or If-Modified-Since produces 304 Not Modified, not 412.

Example response

HTTP
HTTP/1.1 412 Precondition Failed
Date: Fri, 06 Nov 2026 10:15:32 GMT
ETag: "v8"
Content-Type: application/json
Content-Length: 52

{"error":"If-Match does not match the current ETag"}

SEO and redirect checking

412 occurs with conditional writes in APIs and WebDAV, not with crawling; crawlers' conditional GET requests result in 304 or 200. If a redirect check shows 412, check the If-* headers you added as custom request headers.

Common causes and use cases

  • An edit was rejected because the resource changed after it was read (ETag mismatch).
  • If-None-Match: * prevented an existing file from being overwritten.
  • A cloud storage or CDN API received a conditional request with an outdated ETag.

URL Redirect Checker

See every status code a URL returns, hop by hop, with the free TrueURL redirect checker.