Lighttpd config and rewriting/disabling attempts to access favicon.ico

configurationlighttpdrewrite

I've got lighttpd and apache working together on an app I'm building. lighty is serving out static content. However, each time a static asset is requested, I see a not found: favicon.ico message in the logs. I have added the following url rewrite:

url.rewrite-once = (
    "^/favicon.ico$" => "/assets/images/favicon.png"
)

But to no avail; still getting the message. Any ideas?

Best Answer

I would like to suggest a potentially simpler and possibly better solution to your situation.

Why not convert the PNG files to ICO? In fact, icotool seems to exist partially for just this purpose. The following snippet is quoted from the manual page:

icotool -c -o favicon.ico mysite_32x32.png mysite_64x64.png

There are command-line tools as well, such as ImageMagick, should you need to automate resizing of images for such a purpose.

Related Topic