Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer

Hi am assuming you rewrite looks a bit more like this and your trying to rewrite for multiple domains at the same time.

$HTTP["host"] =~ "^$" {
    url.rewrite-once = (
    "^/favicon.ico$" => "/assets/images/favicon.png")

The only other think i can think of off the top of my head is that mod_rewrite is not enabled

server.modules = (

Your rewrite-once rule looks fine to me so i'm guessing it is not in the correct place in you conf file.

share|improve this answer
Hi, my rewrite rule is exactly what I pasted in the question; I'm not matching on any hostname, as only 1 hostname is associated with this server. Where would I need to put the rewrite rules? I've enabled mod_rewrite, and put the rewrite rules near other rewrite rules that are functioning properly. – Kyle Oct 23 '09 at 13:03

If a web browser requests an .ico file, you should not turn around and serve it a .png file anyway. If favicon.ico does not exist on your server, it is proper to serve the browser a 404 error. If you want to keep these error messages out of your log files, that's a different question.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.