vote up 1 vote down star

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?

flag

2 Answers

vote up 0 vote down

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.

link|flag
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 at 13:03
vote up 0 vote down

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.

link|flag

Your Answer

Get an OpenID
or
never shown

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