Everybody knows how to set up a favicon.ico link in HTML:
Not really an answer to the question but simply to compliment the answers given by Marcel and yahelc I offer an elegant solution to the 404 favicon issue.
Because some apps and browsers and whatnot check for a favicon.com and if the icon is not found in the site root you can simply respond to the request with the 204 response header.
Apache Examples:
Apache option one (and my favorite), simple one liner in your .htacces or .conf:
Redirect 204 /favicon.ico
Apache option two:
ErrorDocument 204 ""
For further reading, there is nice blog post by Stoyan Stefanov at http://www.phpied.com/204-no-content/