3

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?

Kyle
  • 141
  • 1
  • 7

3 Answers3

1

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.

0

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"] =~ "^hostname.com$" {
    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 = (
                  "mod_rewrite",

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

Alistair Prestidge
  • 806
  • 1
  • 7
  • 19
  • 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
0

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.