(I'm taking the initiative of moving this part of the thread to
c.i.w.servers.unix.
For new readers: this is about IE5's observed habit, when someone
bookmarks /path/to/something, of requesting /path/to/favicon.ico and
when it doesn't find it, then requesting /favicon.ico from the document
root directory. With the resulting '404' errors in the server's access
and error logs. And what to do about it.
"Now read on" ;-)
> > Seems to me that we need a custom 404 ErrorDocument, that puts out a
> > redirect to the default favicon if no local favicon is found.
> Um - how about a 301 redirection to some well-known and copyrighted
> icon at www.microsoft.com?
IE5 has retrieved one of these icons, to persuade it to try again; it
seems to cache them away in some secret hideyhole that is not cleared
by clearing the cache _or_ the history list. Anyhow...
I'm coming to the conclusion that in this particular context, if IE5
gets a redirection status in response to the request for
/path/to/favicon.ico, it gives that attempt up, and immediately looks
for /favicon.ico instead.
Can anyone confirm or refute this observation, please?
I had thought that configuring an error document, say something like
this
<Files favicon.ico>
ErrorDocument 404 http://www.what.ever/some-other-path/any-browser.ico
</Files>
would mean that in any directory where an icon had not been explicitly
provided, the first attempt would get redirected to some pre-selected
icon (not necessarily the one used for the document root). I had hoped
in this way to avoid multiple copies of the thing getting cached in
proxies etc. However, this doesn't seem to be effective: as I say, my
observations are suggesting that they abandon the retrieval if the
server returns a redirection (I tried both 302 and 301 status).
There's an HTML-based solution described at the MS site:
<LINK REL="SHORTCUT ICON" href="/some-other-path/any-browser.ico">
and this works (and seems harmless enough), as long as this is specified
in the head of every relevant document. Any non-doc-root documents that
don't have that would (a) cut an error record for the first attempt and
then (b) fetch the document root's favicon.ico, assuming there was one.
Adapting the above formula to perform a shortcut rather than an external
redirect:
<Files favicon.ico>
ErrorDocument 404 /some-other-path/any-browser.ico
</Files>
will get the icon to the browser OK without a server error being logged,
right? But these objects will then all be appearing under different
URLs, so I guess multiple instances of them are going to get cached in
proxies, agreed?