414

URI Too Long

Official
The URL is too long, the server is not ready to evaluate it

Specification of the HTTP status code 414

The 414 URI Too Long status code indicates that the server is refusing to service the request because the request-target (Section 5.3 of [RFC7230]) is longer than the server is willing to interpret. This rare condition is only likely to occur when a client has improperly converted a POST request to a GET request with long query information, when the client has descended into a "black hole" of redirection (e.g., a redirected URI prefix that points to a suffix of itself) or when the server is under attack by a client attempting to exploit potential security holes.

A 414 URI Too Long response is cacheable by default; i.e., unless otherwise indicated by the method definition or explicit cache controls (see Section 4.2.2 of [RFC7234]).

Source / Quote by: The 414 URI Too Long HTTP Status Code is specified by section 6.5.12 of RFC7231.

How to throw a 414 statuscode with PHP?

To throw the HTTP status code 414 on a web page, the PHP function http_response_code can be used. The syntax is as follows: http_response_code(414) (PHP 5 >= 5.4.0, PHP 7, PHP 8)

Test the 414 HTTP status code

In order to be able to display the HTTP status code (in this case 414 URI Too Long) and other information on the client side, the development console must be opened with F12. Afterwards you have to navigate to the tab "Network". Now you can open the page, in the network tab you should see the web page (example index.php). This must be selected and then the Herder section must be selected. Here the user will see the following result:

Status code 414 URI Too Long
Overview
URL: https://http-statuscode.com/errorCodeExample.php?code=414
Status: 414 URI Too Long
Those: Network
IP address: XX.XX.XX.XX
Status code 414 URI Too Long

How to create a custom error page for the 414 status code

Creating your own 414 URI Too Long error page is relatively easy with the web server "Apache" as well as with the web server "NGINX".

Apache Webserver

The web server "Apache" is one of the most popular web servers on the Internet. To create an own 414 URI Too Long error page in "Apache", the following change must be made in the following file.

File: .htaccess
ErrorDocument 414 /errors/414.html

NGINX Webserver

Similar to the web server "Apache", "NGINX" is also widely used on the Internet. To create your own 414 URI Too Long error page in "NGINX", the following change must be made in the following file.

File: sites-enabled/default
error_page 414 /414.html;
location = /414.html {
    root /usr/share/nginx/html;
    internal;
}

Browser compatibility of the 414 status code

Chrome no data
Edge no data
Firefox no data
Opera no data
Safari no data
Chrome Android no data
Firefox for Android no data
Opera Android no data
Safari on iOS no data
Internet no data
WebView Android no data

Constants in programming languages

HttpStatusCode.RequestURITooLong
http.StatusRequestURITooLong
Response::HTTP_REQUEST_URI_TOO_LONG
httplib.REQUEST_URI_TOO_LONG
http.client.REQUEST_URI_TOO_LONG
http.HTTPStatus.REQUEST_URI_TOO_LONG
:request_uri_too_long
Author: Tony Brüser
Author: Tony Brüser

AUTHOR_TONY

LinkedInGitHub