I am trying to understand how the communication works between the browser and the server in the case of custom error message.
I understand a 301/302 header which contains the URL of the page in question,
HTTP/1.1 30x ....
Location: http://www.example.org/
but the 404 header does not (as far as I can see).
What tells the browser to go get the error page? I do not have a network sniffer and the question itself generates a huge amount of noise on google
Here is what I see when I trace http:
GET http: //myserver.com/unknownpage HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-gb
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Proxy-Connection: Keep-Alive
Host: myserver.com
Cookie: ...
HTTP/1.1 404 Not Found
Date: Wed, 30 Jan 2013 08:54:52 GMT
Server: Apache
Content-Type: text/html;charset=ISO-8859-1
Transfer-Encoding: chunked
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
GET http: //myserver.com/errorpages/error404.htm HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-gb
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Proxy-Connection: Keep-Alive
Host: myserver.com
Pragma: no-cache
Cookie: ...
HTTP/1.1 200 OK
Date: Wed, 30 Jan 2013 08:54:52 GMT
Server: Apache
Last-Modified: Tue, 22 Jan 2013 16:14:07 GMT
Accept-Ranges: bytes
Content-Type: text/html
Content-Length: 5958
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Age: 0
So my question is what exactly tells the browser to go fetch the custom page? I know how to set it up on Apache, my question is about the communication only