What is a favicon.ico file and why should I have one?
Author: Deron Eriksson
Description: This tutorial describes what a favicon.ico file is and why you should have one in your Apache document root.
Tutorial created using: Windows XP || Apache HTTP Server 2.2.4
A favicon.ico file is that little icon that can appear in your browser URL navigation box, as shown below.
It also appears in your browser list of Favorites, as shown below.
Typically, the favicon.ico file is a 16x16 ico file, although browser support for other types such as gifW and jpegW is growing. Browser support for faviconW files is growing. In the past, it could be quite difficult to get a favicon.ico file to show up next to the page URL in the browser navigation box. New browsers are getting much better at displaying favicon files. The Wikipedia entry about favicon files is quite informative and can be found at http://en.wikipedia.org/wiki/Favicon. The Wikipedia entry discusses code you can place in your web pages to help display your site's favicon file.
Besides having a pretty little icon in the browser navigation box and in the listing of browser favorites, is there any other reason to have a favicon.ico file? Actually, there is. When a browser hits your web site, it will ask for a page, and it can also make a request for the favicon.ico file, as shown in these entries from my ApacheSW access.log file:
127.0.0.1 - - [20/May/2007:20:55:30 -0700] "GET / HTTP/1.1" 200 44 127.0.0.1 - - [20/May/2007:20:55:30 -0700] "GET /favicon.ico HTTP/1.1" 404 209
Did you notice the 404 next to the request for /favicon.ico? That means that the server could not find the /favicon.ico file in its document root directory (ie, /htdocs/ by default).
(Continued on page 2)