Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [users@httpd] Avoid logging errors successfully handled by ErrorDocument
- From: "Robert Andersson" <robert@xxxxxxxxxxxx>
- Subject: Re: [users@httpd] Avoid logging errors successfully handled by ErrorDocument
- Date: Mon, 3 Nov 2003 09:10:04 +0100
Joshua Slive wrote: > The contents of the error log are not configurable (except via the > LogLevel directive). One possible solution would be to use mod_rewrite > rather than an ErrorDocument. See, for example, "Search pages in more > than one directory": > http://httpd.apache.org/docs-2.0/misc/rewriteguide.html > which does something similar. Yes, that worked. Previously I had something like this: ErrorDocument 404 /.../_lib/gallery/img_cachemiss.php?max_width=2048 I now substituted the error document with these lines in an .htaccess: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* /.../_lib/gallery/img_cachemiss.php?max_width=2048 \ [env=GALLERY_CACHEMISS:1] I had a check in that script (img_cachemiss.php), which would only let it execute if REDIRECT_STATUS was 404. The only way I could ensure it not to be executed directly was to add a check for that environment variable. A note here: I was a bit surprised that this worked, because I exploit multiviews here, so the images are requested without their file extensions. I'd have thought that the RewriteCond would kick in on a request for eg. "image" when the existing file is "image.jpeg". It seems as mod_negotiation do the translation before mod_rewrite does its thing. However, I will probably use the ErrorDocument variant most of the time, and survive the occasional 404s in the error log, as it is a simpler and less error prone > > On a related note, is there any way to "pass back" an error, eg. File Not > > Found, to Apache from a dynamic ErrorDocument? ... Could this be > > achieved in some way? > > Not that I know of. I didn't think so either. Thanks anyway. Regards, Robert Andersson --------------------------------------------------------------------- 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@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
- Prev by Date: [users@httpd] How I can get Sample appl. for Panasonic camera WV-NM100?
- Next by Date: RE: [users@httpd] About SSL , Help!
- Previous by thread: [users@httpd] How I can get Sample appl. for Panasonic camera WV-NM100?
- Next by thread: RE: [users@httpd] About SSL , Help!
- Index(es):