414 URI Too Long
The HTTP 414 URI Too Long status code is a client error returned by the server to indicate the URI exceeds the length the server allows.
Usage
When the 414 URI Too Long error message is received, the client understands the server expects a smaller HTTP path or address. While the specification does not stipulate any requirement for length, in practice, browsers limit the size to prevent certain types of attacks.
For example, many web applications limit the size of the URL for an HTTP GET request to 2,048 characters. This is not necessarily a limit enforced by the server or browser.
The 414 URI Too Long response is cacheable by default.
SEO impact
Search engines like Google will not index a URL with a 414 response status. URLs previously indexed will be removed from search results.
Example
The client requests a resource using a URI beyond what the server allows.
Request
GET /<...a_long_URI...> HTTP/1.1
Host: www.example.re
Response
HTTP/1.1 414 URI Too Long
How to fix
The most common cause is a GET request with too many query parameters or excessively long values encoded in the URL. A redirect loop or misconfigured rewrite rule appending parameters on each cycle also triggers this error.
Client-side fixes:
- Shorten the URL by removing unnecessary query parameters
- Move large parameter sets to the request body using POST instead of GET
- Avoid encoding large data structures (JSON blobs, Base64 strings) in the query string
- Check for redirect loops adding parameters on each redirect cycle
nginx: Increase large_client_header_buffers
to allow longer request lines. The directive takes
two values: buffer count and buffer size, e.g.
large_client_header_buffers 4 32k. Restart nginx
to apply.
Apache: Set LimitRequestLine in httpd.conf
to a higher byte value. The default is 8190 bytes.
Values up to 128000 are common for applications with
long URLs. Restart Apache after the change.
IIS: Edit maxUrl and maxQueryString in the
web.config file under system.webServer > security > requestFiltering > requestLimits. The
defaults are 4096 bytes for URL length and 2048
bytes for query strings. Keep these values as low as
practical. Large URL limits increase exposure to
injection attacks.
When the error appears in a browser rather than an API, clearing the browser cache and cookies sometimes resolves the issue, especially when stale cookies inflate the request header size beyond server limits.
Code references
.NET
HttpStatusCode.RequestUriTooLong
Rust
http::StatusCode::URI_TOO_LONG
Rails
:uri_too_long
:request_uri_too_long
Go
http.StatusRequestURITooLong
Symfony
Response::HTTP_REQUEST_URI_TOO_LONG
Python3.5+
http.HTTPStatus.REQUEST_URI_TOO_LONG
Java
java.net.HttpURLConnection.HTTP_REQ_TOO_LONG
Apache HttpComponents Core
org.apache.hc.core5.http.HttpStatus.SC_REQUEST_URI_TOO_LONG
Angular
@angular/common/http/HttpStatusCode.UriTooLong
Takeaway
The 414 URI Too Long status code is a client error indicating the URI is larger than the server is willing to accept.
See also
- RFC 9110: HTTP Semantics
- Google: HTTP status codes and network errors
- GET
- HTTP status codes
- HTTP headers