FREE THOUGHT · FREE SOFTWARE · FREE WORLD

HTTP Status Codes

This is a big update from the last time I looked into this, when I enumerated 57 Status Codes that Apache 2.x was capable of handling. This list contains 83 Status Codes that Apache recognizes. I compiled the latest 2.4.4 Apache in order to view the actual codes sent by a live server.. very cool. You can read about the newest HTTP Status Codes in RFC 6585.

HTTP Status Code Groups

There are 4 main status code groups in Apache. They represent all the status codes from 100 to 600.

  1. 1xx INFO: is the status code informational? ( x >= 100 && x < 200 )
  2. 2xx SUCCESS: is the status code OK? ( x >= 200 && x < 300 )
  3. 3xx REDIRECT: is the status code a redirect? ( x >= 300 && x < 400 )
  4. [45]xx ERROR: is the status code a error (client or server)? ( x >= 400 && x < 600 )
    • 4xx CLIENT_ERROR: is the status code a client error? ( x >= 400 && x < 500 )
    • 5xx SERVER_ERROR: is the status code a server error? ( x >= 500 && x < 600 )

Here is how IANA defineds them.

Status Code Groups

1xx: Informational
Request received, continuing process
2xx: Success
The action was successfully received, understood, and accepted
3xx: Redirection
Further action must be taken in order to complete the request
4xx: Client Error
The request contains bad syntax or cannot be fulfilled
5xx: Server Error
The server failed to fulfill an apparently valid request

HTTP Status Codes

From http_protocol.c and httpd.h - RESPONSE_CODES 83

These are the codes in a shell-script friendly fashion.

1xx Info / Informational

  • 100 Continue
  • 101 Switching Protocols
  • 102 Processing

2xx Success / OK

  • 200 OK
  • 201 Created
  • 202 Accepted
  • 203 Non-Authoritative Information
  • 204 No Content
  • 205 Reset Content
  • 206 Partial Content
  • 207 Multi-Status
  • 208 Already Reported
  • 226 IM Used

3xx Redirect

  • 300 Multiple Choices
  • 301 Moved Permanently
  • 302 Found
  • 303 See Other
  • 304 Not Modified
  • 305 Use Proxy
  • 307 Temporary Redirect
  • 308 Permanent Redirect

4xx Client Error

  • 400 Bad Request
  • 401 Unauthorized
  • 402 Payment Required
  • 403 Forbidden
  • 404 Not Found
  • 405 Method Not Allowed
  • 406 Not Acceptable
  • 407 Proxy Authentication Required
  • 408 Request Timeout
  • 409 Conflict
  • 410 Gone
  • 411 Length Required
  • 412 Precondition Failed
  • 413 Request Entity Too Large
  • 414 Request-URI Too Long
  • 415 Unsupported Media Type
  • 416 Requested Range Not Satisfiable
  • 417 Expectation Failed
  • 422 Unprocessable Entity
  • 423 Locked
  • 424 Failed Dependency
  • 426 Upgrade Required
  • 428 Precondition Required
  • 429 Too Many Requests
  • 431 Request Header Fields Too Large

5xx Server Error

  • 500 Internal Server Error
  • 501 Not Implemented
  • 502 Bad Gateway
  • 503 Service Unavailable
  • 504 Gateway Timeout
  • 505 HTTP Version Not Supported
  • 506 Variant Also Negotiates
  • 507 Insufficient Storage
  • 508 Loop Detected
  • 510 Not Extended
  • 511 Network Authentication Required

HTTP Header Viewer

Want to check the HTTP Headers? Use my Header Viewer. I recently added Hexdumps.

http-status-codes-tool

Full Headers and Content

I wrote a simple script to trigger all 83 Response Codes, using the super cool Htaccess Redirect/ErrorDocument trick, and saved the headers and body from each for your viewing pleasure. This is from Apache 2.4.4 for the 83 Status Codes.

Example: My 503 Error Page

HTTP-Status-Codes

1xx Info / Informational

100 Continue

HTTP/1.1 100 Continue
Date: Sat, 06 Apr 2013 21:10:39 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 502
Content-Type: text/html; charset=iso-8859-1



100 Continue

Continue

101 Switching Protocols

HTTP/1.1 101 Switching Protocols
Date: Sat, 06 Apr 2013 21:10:39 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 524
Content-Type: text/html; charset=iso-8859-1



101 Switching Protocols

Switching Protocols

102 Processing

HTTP/1.1 102 Processing
Date: Sat, 06 Apr 2013 21:10:39 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 506
Content-Type: text/html; charset=iso-8859-1



102 Processing

Processing

2xx Success / OK

200 OK

HTTP/1.1 200 OK
Date: Sat, 06 Apr 2013 21:10:39 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 490
Content-Type: text/html; charset=iso-8859-1



200 OK

OK

201 Created

HTTP/1.1 201 Created
Date: Sat, 06 Apr 2013 21:10:39 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 500
Content-Type: text/html; charset=iso-8859-1



201 Created

Created

202 Accepted

HTTP/1.1 202 Accepted
Date: Sat, 06 Apr 2013 21:10:39 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 502
Content-Type: text/html; charset=iso-8859-1



202 Accepted

Accepted

203 Non-Authoritative Information

HTTP/1.1 203 Non-Authoritative Information
Date: Sat, 06 Apr 2013 21:10:39 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 544
Content-Type: text/html; charset=iso-8859-1



203 Non-Authoritative Information

Non-Authoritative Information

204 No Content

HTTP/1.1 204 No Content
Date: Sat, 06 Apr 2013 21:10:39 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 0

205 Reset Content

HTTP/1.1 205 Reset Content
Date: Sat, 06 Apr 2013 21:10:39 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 512
Content-Type: text/html; charset=iso-8859-1



205 Reset Content

Reset Content

206 Partial Content

HTTP/1.1 206 Partial Content
Date: Sat, 06 Apr 2013 21:10:39 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 516
Content-Type: text/html; charset=iso-8859-1



206 Partial Content

Partial Content

207 Multi-Status

HTTP/1.1 207 Multi-Status
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 510
Content-Type: text/html; charset=iso-8859-1



207 Multi-Status

Multi-Status

208 Already Reported

HTTP/1.1 208 Already Reported
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 518
Content-Type: text/html; charset=iso-8859-1



208 Already Reported

Already Reported

226 IM Used

HTTP/1.1 226 IM Used
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 500
Content-Type: text/html; charset=iso-8859-1



226 IM Used

IM Used

3xx Redirect

CodeDescription
300 (Multiple choices)The server has several actions available based on the request. The server may choose an action based on the requestor (user agent) or the server may present a list so the requestor can choose an action.
301 Moved PermanentlyThis and all future requests should be directed to the given URI.
302 (Moved temporarily)The server is currently responding to the request with a page from a different location, but the requestor should continue to use the original location for future requests. This code is similar to a 301 in that for a GET or HEAD request, it automatically forwards the requestor to a different location, but you shouldn't use it to tell the Googlebot that a page or site has moved because Googlebot will continue to crawl and index the original location.
303 See Other (since HTTP/1.1)The response to the request can be found under another URI using a GET method. When received in response to a POST (or PUT/DELETE), it should be assumed that the server has received the data and the redirect should be issued with a separate GET message.
304 (Not modified)

The requested page hasn't been modified since the last request. When the server returns this response, it doesn't return the contents of the page.

You should configure your server to return this response (called the If-Modified-Since HTTP header) when a page hasn't changed since the last time the requestor asked for it. This saves you bandwidth and overhead because your server can tell Googlebot that a page hasn't changed since the last time it was crawled.

305 Use Proxy (since HTTP/1.1)The requested resource is only available through a proxy, whose address is provided in the response. Many HTTP clients (such as Mozilla and Internet Explorer) do not correctly handle responses with this status code, primarily for security reasons.
306 Switch ProxyNo longer used. Originally meant "Subsequent requests should use the specified proxy."
307 (Temporary redirect)The server is currently responding to the request with a page from a different location, but the requestor should continue to use the original location for future requests. This code is similar to a 301 in that for a GET or HEAD request, it automatically forwards the requestor to a different location, but you shouldn't use it to tell the Googlebot that a page or site has moved because Googlebot will continue to crawl and index the original location.
308 (Permanent redirect)The target resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the effective request URI to one or more of the new references returned by the server, where possible. Caches MAY use a heuristic to determine freshness for 308 responses. The new permanent URI SHOULD be given by the Location field in the response. A response payload can contain a short hypertext note with a hyperlink to the new URI(s). Note: This status code is similar to 301 Moved Permanently, except that it does not allow rewriting the request method from POST to GET.
+---------------------------------------------------------------+-----------+-----------+
|                                                               | Permanent | Temporary |
+---------------------------------------------------------------+-----------+-----------+
| Allows changing the request method from POST to GET           | 301       | 302       |
|                                                               |           |           |
| Does not allow changing the request method from POST to GET   | 308       | 307       |
+---------------------------------------------------------------+-----------+-----------+

4xx Client Error

400 Bad Request

HTTP/1.1 400 Bad Request
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1



400 Bad Request

Bad Request

Your browser sent a request that this server could not understand.

401 Unauthorized

HTTP/1.1 401 Unauthorized
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 381
Content-Type: text/html; charset=iso-8859-1



401 Unauthorized

Unauthorized

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

402 Payment Required

HTTP/1.1 402 Payment Required
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 518
Content-Type: text/html; charset=iso-8859-1



402 Payment Required

Payment Required

403 Forbidden

HTTP/1.1 403 Forbidden
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 207
Content-Type: text/html; charset=iso-8859-1



403 Forbidden

Forbidden

You don't have permission to access /e/403 on this server.

404 Not Found

HTTP/1.1 404 Not Found
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 203
Content-Type: text/html; charset=iso-8859-1



404 Not Found

Not Found

The requested URL /e/404 was not found on this server.

405 Method Not Allowed

HTTP/1.1 405 Method Not Allowed
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Allow: TRACE
Content-Length: 226
Content-Type: text/html; charset=iso-8859-1



405 Method Not Allowed

Method Not Allowed

The requested method GET is not allowed for the URL /e/405.

406 Not Acceptable

HTTP/1.1 406 Not Acceptable
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 256
Content-Type: text/html; charset=iso-8859-1



406 Not Acceptable

Not Acceptable

An appropriate representation of the requested resource /e/406 could not be found on this server.

407 Proxy Authentication Required

HTTP/1.1 407 Proxy Authentication Required
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 415
Content-Type: text/html; charset=iso-8859-1



407 Proxy Authentication Required

Proxy Authentication Required

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

408 Request Timeout

HTTP/1.1 408 Request Timeout
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 221
Connection: close
Content-Type: text/html; charset=iso-8859-1



408 Request Timeout

Request Timeout

Server timeout waiting for the HTTP request from the client.

409 Conflict

HTTP/1.1 409 Conflict
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 502
Content-Type: text/html; charset=iso-8859-1



409 Conflict

Conflict

410 Gone

HTTP/1.1 410 Gone
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 300
Content-Type: text/html; charset=iso-8859-1



410 Gone

Gone

The requested resource
/e/410
is no longer available on this server and there is no forwarding address. Please remove all references to this resource.

411 Length Required

HTTP/1.1 411 Length Required
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 238
Connection: close
Content-Type: text/html; charset=iso-8859-1



411 Length Required

Length Required

A request of the requested method GET requires a valid Content-length.

412 Precondition Failed

HTTP/1.1 412 Precondition Failed
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 239
Content-Type: text/html; charset=iso-8859-1



412 Precondition Failed

Precondition Failed

The precondition on the request for the URL /e/412 evaluated to false.

413 Request Entity Too Large

HTTP/1.1 413 Request Entity Too Large
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 333
Connection: close
Content-Type: text/html; charset=iso-8859-1



413 Request Entity Too Large

Request Entity Too Large

The requested resource
/e/413
does not allow request data with GET requests, or the amount of data provided in the request exceeds the capacity limit.

414 Request-URI Too Long

HTTP/1.1 414 Request-URI Too Long
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 248
Connection: close
Content-Type: text/html; charset=iso-8859-1



414 Request-URI Too Long

Request-URI Too Long

The requested URL's length exceeds the capacity limit for this server.

415 Unsupported Media Type

HTTP/1.1 415 Unsupported Media Type
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 263
Content-Type: text/html; charset=iso-8859-1



415 Unsupported Media Type

Unsupported Media Type

The supplied request data is not in a format acceptable for processing by this resource.

416 Requested Range Not Satisfiable

HTTP/1.1 416 Requested Range Not Satisfiable
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 314
Content-Type: text/html; charset=iso-8859-1



416 Requested Range Not Satisfiable

Requested Range Not Satisfiable

None of the range-specifier values in the Range request-header field overlap the current extent of the selected resource.

417 Expectation Failed

HTTP/1.1 417 Expectation Failed
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 312
Content-Type: text/html; charset=iso-8859-1



417 Expectation Failed

Expectation Failed

No expectation was seen, the Expect request-header field was not presented by the client.

Only the 100-continue expectation is supported.

422 Unprocessable Entity

HTTP/1.1 422 Unprocessable Entity
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 285
Content-Type: text/html; charset=iso-8859-1



422 Unprocessable Entity

Unprocessable Entity

The server understands the media type of the request entity, but was unable to process the contained instructions.

423 Locked

HTTP/1.1 423 Locked
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 277
Content-Type: text/html; charset=iso-8859-1



423 Locked

Locked

The requested resource is currently locked. The lock must be released or proper identification given before the method can be applied.

424 Failed Dependency

HTTP/1.1 424 Failed Dependency
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 300
Content-Type: text/html; charset=iso-8859-1



424 Failed Dependency

Failed Dependency

The method could not be performed on the resource because the requested action depended on another action and that other action failed.

426 Upgrade Required

HTTP/1.1 426 Upgrade Required
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 385
Content-Type: text/html; charset=iso-8859-1



426 Upgrade Required

Upgrade Required

The requested resource can only be retrieved using SSL. The server is willing to upgrade the current connection to SSL, but your client doesn't support it. Either upgrade your client, or try requesting the page using https://

428 Precondition Required

HTTP/1.1 428 Precondition Required
Date: Sat, 06 Apr 2013 21:10:40 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 215
Content-Type: text/html; charset=iso-8859-1



428 Precondition Required

Precondition Required

The request is required to be conditional.

429 Too Many Requests

HTTP/1.1 429 Too Many Requests
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 227
Content-Type: text/html; charset=iso-8859-1



429 Too Many Requests

Too Many Requests

The user has sent too many requests in a given amount of time.

431 Request Header Fields Too Large

HTTP/1.1 431 Request Header Fields Too Large
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 273
Content-Type: text/html; charset=iso-8859-1



431 Request Header Fields Too Large

Request Header Fields Too Large

The server refused this request because the request header fields are too large.

5xx Server Error

500 Internal Server Error

HTTP/1.1 500 Internal Server Error
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 528
Connection: close
Content-Type: text/html; charset=iso-8859-1



500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at you@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

501 Not Implemented

HTTP/1.1 501 Not Implemented
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Allow: TRACE
Content-Length: 196
Connection: close
Content-Type: text/html; charset=iso-8859-1



501 Not Implemented

Not Implemented

GET to /e/501 not supported.

502 Bad Gateway

HTTP/1.1 502 Bad Gateway
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 232
Content-Type: text/html; charset=iso-8859-1



502 Bad Gateway

Bad Gateway

The proxy server received an invalid response from an upstream server.

503 Service Unavailable

HTTP/1.1 503 Service Unavailable
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 299
Connection: close
Content-Type: text/html; charset=iso-8859-1



503 Service Unavailable

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

504 Gateway Timeout

HTTP/1.1 504 Gateway Timeout
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 247
Content-Type: text/html; charset=iso-8859-1



504 Gateway Timeout

Gateway Timeout

The gateway did not receive a timely response from the upstream server or application.

505 HTTP Version Not Supported

HTTP/1.1 505 HTTP Version Not Supported
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 538
Content-Type: text/html; charset=iso-8859-1



505 HTTP Version Not Supported

HTTP Version Not Supported

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at you@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

506 Variant Also Negotiates

HTTP/1.1 506 Variant Also Negotiates
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 304
Content-Type: text/html; charset=iso-8859-1



506 Variant Also Negotiates

Variant Also Negotiates

A variant for the requested resource <pre> /e/506 </pre> is itself a negotiable resource. This indicates a configuration error.

507 Insufficient Storage

HTTP/1.1 507 Insufficient Storage
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 389
Content-Type: text/html; charset=iso-8859-1



507 Insufficient Storage

Insufficient Storage

The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. There is insufficient free space left in your storage allocation.

508 Loop Detected

HTTP/1.1 508 Loop Detected
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 232
Content-Type: text/html; charset=iso-8859-1



508 Loop Detected

Loop Detected

The server terminated an operation because it encountered an infinite loop.

510 Not Extended

HTTP/1.1 510 Not Extended
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 247
Content-Type: text/html; charset=iso-8859-1



510 Not Extended

Not Extended

A mandatory extension policy in the request is not accepted by the server for this resource.

511 Network Authentication Required

HTTP/1.1 511 Network Authentication Required
Date: Sat, 06 Apr 2013 21:10:41 GMT
Server: Apache/2.4.4 (Unix)
Content-Length: 249
Content-Type: text/html; charset=iso-8859-1



511 Network Authentication Required

Network Authentication Required

The client needs to authenticate to gain network access.

Total Unsupported Errors

Success Codes: 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225 are all currently unsupported.

Redirect Codes: 300, 301, 302, 303, 304, 305, 306, 307, 308, all returned the correct ErrorDocument but due to the updates to Apache they then continue through and return the redirect url (issuing 404) instead of the actual 3xx (codes). Now they correctly redirect basically, whereas in earlier versions you could trick Apache into sending the Headers and ErrorDocument specific to the 3xx. No biggie, everyone knows the 3xx.

Client Error Codes: 418, 419, 420, 421, 425, 427, 430 currently unsupported.

Server Error Code: 509 currently unsupported.

Creating ErrorDocument Output

Htaccess Used for Triggers

Basically just save this as your .htaccess file. Then when you request, /e/503, it will trigger a 503 response. Took me a long time to come up with this trick btw.. More info about this ErrorDocument triggering trick.

Then I compiled the latest 2.4.4 Apache HTTPD from source and set it up on a staging server in order to get the newest Apache responses. The 2.2 Apaches and below had 57 codes vs 2.4.4 has 83.

ErrorDocument 100 default
ErrorDocument 101 default
errorDocument 102 default
ErrorDocument 200 default
ErrorDocument 201 default
ErrorDocument 202 default
ErrorDocument 203 default
ErrorDocument 204 default
ErrorDocument 205 default
ErrorDocument 206 default
ErrorDocument 207 default
ErrorDocument 208 default
ErrorDocument 400 default
ErrorDocument 401 default
ErrorDocument 402 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 407 default
ErrorDocument 408 default
ErrorDocument 409 default
ErrorDocument 410 default
ErrorDocument 411 default
ErrorDocument 412 default
ErrorDocument 413 default
ErrorDocument 414 default
ErrorDocument 415 default
ErrorDocument 416 default
ErrorDocument 417 default

Redirect 100 /e/100
Redirect 101 /e/101
Redirect 102 /e/102
Redirect 200 /e/200
Redirect 201 /e/201
Redirect 202 /e/202
Redirect 203 /e/203
Redirect 204 /e/204
Redirect 205 /e/205
Redirect 206 /e/206
Redirect 207 /e/207
Redirect 208 /e/208
Redirect 209 /e/209
Redirect 210 /e/210
Redirect 211 /e/211
Redirect 212 /e/212
Redirect 213 /e/213
Redirect 214 /e/214
Redirect 215 /e/215
Redirect 216 /e/216
Redirect 217 /e/217
Redirect 218 /e/218
Redirect 219 /e/219
Redirect 220 /e/220
Redirect 221 /e/221
Redirect 222 /e/222
Redirect 223 /e/223
Redirect 224 /e/224
Redirect 225 /e/225
Redirect 226 /e/226
Redirect 400 /e/400
Redirect 401 /e/401
Redirect 402 /e/402
Redirect 403 /e/403
Redirect 404 /e/404
Redirect 405 /e/405
Redirect 406 /e/406
Redirect 407 /e/407
Redirect 408 /e/408
Redirect 409 /e/409
Redirect 410 /e/410
Redirect 411 /e/411
Redirect 412 /e/412
Redirect 413 /e/413
Redirect 414 /e/414
Redirect 415 /e/415
Redirect 416 /e/416
Redirect 417 /e/417
Redirect 418 /e/418
Redirect 419 /e/419
Redirect 420 /e/420
Redirect 421 /e/421
Redirect 422 /e/422
Redirect 423 /e/423
Redirect 424 /e/424
Redirect 425 /e/425
Redirect 426 /e/426
Redirect 427 /e/427
Redirect 428 /e/428
Redirect 429 /e/429
Redirect 430 /e/430
Redirect 431 /e/431
Redirect 500 /e/500
Redirect 501 /e/501
Redirect 502 /e/502
Redirect 503 /e/503
Redirect 504 /e/504
Redirect 505 /e/505
Redirect 506 /e/506
Redirect 507 /e/507
Redirect 508 /e/508
Redirect 509 /e/509
Redirect 510 /e/510
Redirect 511 /e/511

cURL Script for Headers and Output

Just a simple shell script you can run from Bash after setting up the Htaccess Triggering. This just loops through all 83 Codes and requests the special uri that causes Apache to respond with the HTTP Status Code and Relevant ErrorDocument.

for c in 100 101 102 \
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 \
300 301 302 303 304 305 306 307 308 \
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 \
500 501 502 503 504 505 506 507 508 509 510 511;
do
   curl -L4siv -o - --connect-timeout 1 --max-time 1 --retry 0 --max-redirs 3 -A 'AskApache' -e 'localhost' --resolve a.com:80:127.0.0.1 http://a.com/e/${c} 2>&1;
done;

Extra Info

Apache Internal Status Code Names

The rest of the 83 Codes are NULL for future use.

  • 100 = HTTP_CONTINUE
  • 101 = HTTP_SWITCHING_PROTOCOLS
  • 102 = HTTP_PROCESSING
  • 200 = HTTP_OK
  • 201 = HTTP_CREATED
  • 202 = HTTP_ACCEPTED
  • 203 = HTTP_NON_AUTHORITATIVE
  • 204 = HTTP_NO_CONTENT
  • 205 = HTTP_RESET_CONTENT
  • 206 = HTTP_PARTIAL_CONTENT
  • 207 = HTTP_MULTI_STATUS
  • 208 = HTTP_ALREADY_REPORTED
  • 226 = HTTP_IM_USED
  • 300 = HTTP_MULTIPLE_CHOICES
  • 301 = HTTP_MOVED_PERMANENTLY
  • 302 = HTTP_MOVED_TEMPORARILY
  • 303 = HTTP_SEE_OTHER
  • 304 = HTTP_NOT_MODIFIED
  • 305 = HTTP_USE_PROXY
  • 307 = HTTP_TEMPORARY_REDIRECT
  • 308 = HTTP_PERMANENT_REDIRECT
  • 400 = HTTP_BAD_REQUEST
  • 401 = HTTP_UNAUTHORIZED
  • 402 = HTTP_PAYMENT_REQUIRED
  • 403 = HTTP_FORBIDDEN
  • 404 = HTTP_NOT_FOUND
  • 405 = HTTP_METHOD_NOT_ALLOWED
  • 406 = HTTP_NOT_ACCEPTABLE
  • 407 = HTTP_PROXY_AUTHENTICATION_REQUIRED
  • 408 = HTTP_REQUEST_TIME_OUT
  • 409 = HTTP_CONFLICT
  • 410 = HTTP_GONE
  • 411 = HTTP_LENGTH_REQUIRED
  • 412 = HTTP_PRECONDITION_FAILED
  • 413 = HTTP_REQUEST_ENTITY_TOO_LARGE
  • 414 = HTTP_REQUEST_URI_TOO_LARGE
  • 415 = HTTP_UNSUPPORTED_MEDIA_TYPE
  • 416 = HTTP_RANGE_NOT_SATISFIABLE
  • 417 = HTTP_EXPECTATION_FAILED
  • 422 = HTTP_UNPROCESSABLE_ENTITY
  • 423 = HTTP_LOCKED
  • 424 = HTTP_FAILED_DEPENDENCY
  • 426 = HTTP_UPGRADE_REQUIRED
  • 428 = HTTP_PRECONDITION_REQUIRED
  • 429 = HTTP_TOO_MANY_REQUESTS
  • 431 = HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE
  • 500 = HTTP_INTERNAL_SERVER_ERROR
  • 501 = HTTP_NOT_IMPLEMENTED
  • 502 = HTTP_BAD_GATEWAY
  • 503 = HTTP_SERVICE_UNAVAILABLE
  • 504 = HTTP_GATEWAY_TIME_OUT
  • 505 = HTTP_VERSION_NOT_SUPPORTED
  • 506 = HTTP_VARIANT_ALSO_VARIES
  • 507 = HTTP_INSUFFICIENT_STORAGE
  • 508 = HTTP_LOOP_DETECTED
  • 510 = HTTP_NOT_EXTENDED
  • 511 = HTTP_NETWORK_AUTHENTICATION_REQUIRED

3xx Browser Support / Live Tests

Test 3xx Redirection Capabilities of your browser. Thanks to green bytes!

Test CaseFirefox 18Microsoft IE 9Microsoft IE 10 (Consumer Preview)Opera 12Safari 5.1 Google Chrome 22Konqueror 4.7.2
Summary 100% passes, 0% failures, 0% warnings, 0% unsupported, 0% to-do
Score: 100
89% passes, 11% failures, 0% warnings, 0% unsupported, 0% to-do
Score: 89
91% passes, 9% failures, 0% warnings, 0% unsupported, 0% to-do
Score: 91
85% passes, 15% failures, 0% warnings, 0% unsupported, 0% to-do
Score: 85
89% passes, 11% failures, 0% warnings, 0% unsupported, 0% to-do
Score: 89
100% passes, 0% failures, 0% warnings, 0% unsupported, 0% to-do
Score: 100
64% passes, 36% failures, 0% warnings, 0% unsupported, 0% to-do
Score: 64

Connection Dropped

Apache drops the connection for these codes.

  • 400 BAD_REQUEST
  • 408 REQUEST_TIME_OUT
  • 411 LENGTH_REQUIRED
  • 413 REQUEST_ENTITY_TOO_LARGE
  • 414 REQUEST_URI_TOO_LARGE
  • 500 INTERNAL_SERVER_ERROR
  • 503 SERVICE_UNAVAILABLE
  • 501 NOT_IMPLEMENTED

Status Codes in C

Probably my all time favorite, from Wireshark.

static const value_string vals_status_code[] = {
	{ 100, "Continue" },
	{ 101, "Switching Protocols" },
	{ 102, "Processing" },
	{ 199, "Informational - Others" },

	{ 200, "OK"},
	{ 201, "Created"},
	{ 202, "Accepted"},
	{ 203, "Non-authoritative Information"},
	{ 204, "No Content"},
	{ 205, "Reset Content"},
	{ 206, "Partial Content"},
	{ 207, "Multi-Status"},
	{ 299, "Success - Others"},

	{ 300, "Multiple Choices"},
	{ 301, "Moved Permanently"},
	{ 302, "Found"},
	{ 303, "See Other"},
	{ 304, "Not Modified"},
	{ 305, "Use Proxy"},
	{ 307, "Temporary Redirect"},
	{ 399, "Redirection - Others"},

	{ 400, "Bad Request"},
	{ 401, "Unauthorized"},
	{ 402, "Payment Required"},
	{ 403, "Forbidden"},
	{ 404, "Not Found"},
	{ 405, "Method Not Allowed"},
	{ 406, "Not Acceptable"},
	{ 407, "Proxy Authentication Required"},
	{ 408, "Request Time-out"},
	{ 409, "Conflict"},
	{ 410, "Gone"},
	{ 411, "Length Required"},
	{ 412, "Precondition Failed"},
	{ 413, "Request Entity Too Large"},
	{ 414, "Request-URI Too Long"},
	{ 415, "Unsupported Media Type"},
	{ 416, "Requested Range Not Satisfiable"},
	{ 417, "Expectation Failed"},
	{ 418, "I'm a teapot"},		/* RFC 2324 */
	{ 422, "Unprocessable Entity"},
	{ 423, "Locked"},
	{ 424, "Failed Dependency"},
	{ 499, "Client Error - Others"},

	{ 500, "Internal Server Error"},
	{ 501, "Not Implemented"},
	{ 502, "Bad Gateway"},
	{ 503, "Service Unavailable"},
	{ 504, "Gateway Time-out"},
	{ 505, "HTTP Version not supported"},
	{ 507, "Insufficient Storage"},
	{ 599, "Server Error - Others"},

	{ 0, 	NULL}
};

PHP of Updated Codes

This type of table is used by software like WordPress, Zend, Snoopy, Curl, you name it. Always good to update.

array(
	// INFORMATIONAL CODES
	100 => 'Continue',
	101 => 'Switching Protocols',
	102 => 'Processing',
	
	// SUCCESS CODES
	200 => 'OK',
	201 => 'Created',
	202 => 'Accepted',
	203 => 'Non-Authoritative Information',
	204 => 'No Content',
	205 => 'Reset Content',
	206 => 'Partial Content',
	207 => 'Multi-status',
	208 => 'Already Reported',
	
	// REDIRECTION CODES
	300 => 'Multiple Choices',
	301 => 'Moved Permanently',
	302 => 'Found',
	303 => 'See Other',
	304 => 'Not Modified',
	305 => 'Use Proxy',
	306 => 'Switch Proxy', // Deprecated
	307 => 'Temporary Redirect',
	
	// CLIENT ERROR
	400 => 'Bad Request',
	401 => 'Unauthorized',
	402 => 'Payment Required',
	403 => 'Forbidden',
	404 => 'Not Found',
	405 => 'Method Not Allowed',
	406 => 'Not Acceptable',
	407 => 'Proxy Authentication Required',
	408 => 'Request Time-out',
	409 => 'Conflict',
	410 => 'Gone',
	411 => 'Length Required',
	412 => 'Precondition Failed',
	413 => 'Request Entity Too Large',
	414 => 'Request-URI Too Large',
	415 => 'Unsupported Media Type',
	416 => 'Requested range not satisfiable',
	417 => 'Expectation Failed',
	418 => 'I\'m a teapot',
	422 => 'Unprocessable Entity',
	423 => 'Locked',
	424 => 'Failed Dependency',
	425 => 'Unordered Collection',
	426 => 'Upgrade Required',
	428 => 'Precondition Required',
	429 => 'Too Many Requests',
	431 => 'Request Header Fields Too Large',
	
	// SERVER ERROR
	500 => 'Internal Server Error',
	501 => 'Not Implemented',
	502 => 'Bad Gateway',
	503 => 'Service Unavailable',
	504 => 'Gateway Time-out',
	505 => 'HTTP Version not supported',
	506 => 'Variant Also Negotiates',
	507 => 'Insufficient Storage',
	508 => 'Loop Detected',
	511 => 'Network Authentication Required'
);
  • RFC 6585 - Additional HTTP Status Codes, 2012
  • RFC 2295 - Transparent Content Negotiation in HTTP, March 1998.
  • RFC 2518 - HTTP Extensions for Distributed Authoring -- WEBDAV, February 1999.
  • RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1, June 1999.
  • RFC 2774 - An HTTP Extension Framework, February 2000.
  • RFC 2817 - Upgrading to TLS Within HTTP/1.1, May 2000.
  • RFC 3229 - Delta encoding in HTTP, January 2002.
  • RFC 4918 - HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV), June 2007.
  • HTTP Status Code 308

More Reading

Net Apache cURL ErrorDocument Htaccess HTTP HTTP Headers Redirect Status Code

 

 

Comments