httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] 404 error byte logging
Date Sat, 25 Feb 2006 01:12:38 GMT
On 2/24/06, David Hubbard <dhubbard@dino.hostasaurus.com> wrote:
> Hi all, sorry if this has been asked before, couldn't find
> it in the archives.  I was curious about why Apache logs
> the bytes of the 404 error document to a 404 request in the
> log when that is only actually accurate for 404's involving
> pages that the browser actually accepts the error document?
> For example, if I have a page with 5 bad images on
> it and my error document is 50 kilobytes in size, the log
> will reflect 50 kilobytes transferred on the 404 request
> for each of the five bad images when a sniffer shows my
> machine received nothing more than a kilobyte or two of
> http traffic from the http conversation while determining
> those images were bad and that it didn't have anything to
> display.  If I requested a missing html page, yes, I'd get
> the whole 50 kilobyte error document but not in the case of
> content that would not display the error document.
>
> Is there a way around this?  Other than telling customers
> to write better html code that doesn't cause 404's? :-)

The ErrorDocument is sent every time the 404 error occurs.  It is just
that in some cases (embedded images, for example), the browser throws
away the content.

If you are worried about this and don't want to fix your documents,
you can set the ErrorDocument for images to somthing smaller, as in
<FilesMatch \.gif$>
ErrorDocument 404 "Not Found"
</FilesMatch>

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message