HTTP 308 Permanent Redirect vs 431 Request Header Fields Too Large
HTTP 308 (Permanent Redirect) is a 3xx Redirection response, while 431 (Request Header Fields Too Large) is a 4xx Client Error response. 308 indicates that the resource has been permanently moved. Like 301, but guarantees the HTTP method will NOT be changed. In contrast, 431 means that the server refuses to process the request because an individual header field or all headers collectively are too large.
Description
The resource has been permanently moved. Like 301, but guarantees the HTTP method will NOT be changed.
When You See It
For permanent URL changes where POST requests must remain POST.
How to Fix
Update all references to the new URL. The HTTP method is preserved.
Description
The server refuses to process the request because an individual header field or all headers collectively are too large.
When You See It
When cookies accumulate to an excessive size, or a single header (like Authorization) is too long.
How to Fix
Reduce header sizes. Clear excessive cookies. Use shorter tokens.
Key Differences
308 is a 3xx Redirection response, while 431 is a 4xx Client Error response.
HTTP 308: The resource has been permanently moved. Like 301, but guarantees the HTTP method will NOT be changed.
HTTP 431: The server refuses to process the request because an individual header field or all headers collectively are too large.
You encounter 308 when for permanent URL changes where POST requests must remain POST.
You encounter 431 when when cookies accumulate to an excessive size, or a single header (like Authorization) is too long.
When to Use Which
For 308 (Permanent Redirect): Update all references to the new URL. The HTTP method is preserved. For 431 (Request Header Fields Too Large): Reduce header sizes. Clear excessive cookies. Use shorter tokens.