510

Not Extended

Official
expectation was not met

Specification of the HTTP status code 510

The policy for accessing the resource has not been met in the request. The server should send back all the information necessary for the client to issue an extended request. It is outside the scope of this specification to specify how the extensions inform the client. If the 510 Not Extended response contains information about extensions that were not present in the initial request then the client MAY repeat the request if it has reason to believe it can fulfill the extension policy by modifying the request according to the information provided in the 510 Not Extended response. Otherwise the client MAY present any entity included in the 510 Not Extended response to the user, since that entity may include relevant diagnostic information.

Source / Quote by: The 510 Not Extended HTTP Status Code is specified by section 7 of RFC2774.

How to throw a 510 statuscode with PHP?

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

Test the 510 HTTP status code

In order to be able to display the HTTP status code (in this case 510 Not Extended) 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 510 Not Extended
Overview
URL: https://http-statuscode.com/errorCodeExample.php?code=510
Status: 510 Not Extended
Those: Network
IP address: XX.XX.XX.XX
Status code 510 Not Extended

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

Creating your own 510 Not Extended 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 510 Not Extended error page in "Apache", the following change must be made in the following file.

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

NGINX Webserver

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

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

Browser compatibility of the 510 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

http.StatusNotExtended
Response::HTTP_NOT_EXTENDED
:not_extended
Author: Tony Brüser
Author: Tony Brüser

Tony Brüser is an enthusiastic web developer with a penchant for HTTP status codes.

LinkedInGitHub