Fix missing favicon on IE7

I just fix a missing favicon problem in IE7 for my work few day ago, i would like to share how i fixed it after trying a few different solution. so the original code that i have on the site is

<link rel="SHORTCUT ICON" href="/favicon.ico" />

since i using firefox as my major development browser and this code display the favicon perfectly ok on firefox , i thought this is the correct way to using it ( ya i know by right i should check this againts  cross browser )  until the users file a bug on this , the favicon is not showing on IE 7.

after some research on the web and doing some testing on the site , finally i found the solution , there are 2 thing i have miss out

  • IE7 have a bug to recognize favicon on relative path, that why the path for the icon must be aboslute path , which mean the ico image file with full domain.
  • there is a need to declare the mime type for favicon , which is the  type="image/x-icon".

<link rel="shortcut icon" href="http://domain/favicon.ico" type="image/x-icon" />

after this you might still not seeing the favicon appear on your IE , you need to clear your cache first and reload the site, the first time be slightly slower but it should be display the favicon after a while. Below is the image what favicon is , in case some of the reader don’t know.

favicon

You may also like...