Specifying a default Favicon in Apache

If you didn’t already know, I love Apache. Defining a favicon is a nice detail to add to your site, you already know that. But did you know you can specify a default favicon on your Apache web server that can span across virtual hosts? Of course this would be overridden if a site chooses to use their own.

The 404 handler catches any requests for favicon.ico (requests for favicon.ico is after all, normal behaviour for common web browsers) that don’t exist, and displays the default.

AddType image/x-icon .ico

ErrorDocument 404 /icons/favicon.ico (this is your /icons directory under ServerRoot)

SC pointed out this link to me (thanks), well worth a read:


UPDATE: If you’ve after information on iPhone and iPad icons, you might be interested in my article on iPhone and iPad Web Clip icons.