I was quiet disapointed to learn that all 3 php open source tools that I am using do NOT correctly implement favicons.
(Image copied from Wikipedia)
Here are 3 excellent resources on the correct implementation of favicons:
The first link is for real browsers and the second is for ie rubbish. I have shown the XHTML version here in the href values, which are just as acceptable as HTML. There was a time when this was the correct implementation, but image/x-icon has now been superceded by image/vnd.microsoft.icon which is now part of the IANA standard for MIME types. By the way, older versions of ie just looked for a file name "/favicon.ico" which was hard-coded. If you wanted to be ultra safe, you should name your favicon as favicon.ico. Of course that does not help you if your domain hosts multiple web-sites for different purposes, as does mine.
About the 2nd (MS) link tag: Although it is always nice to include a specified MIME type, it is even nicer to go exactly by specs. If you look at the referenced MS spec for adding a Favourites Icon, the MIME type is not mentioned.
So, in summary the best implementation for cross-browser favicon is
For .ico type:
<link rel="icon" type="image/vnd.microsoft.icon" href="http://www.example.com/image.ico"> <!-- For good browsers. -->
<link rel="SHORTCUT ICON" href="http://www.example.com/image.ico"/> <!-- For Internet Explorer-->
For evidence, see Favicons test.
Because MSIE does NOT supports png, gif and jpeg type icons. If your preferred favicon is one of these types, then you need to have an alternative version in .ico format, just for MSIE rendering. For example with jpg:
<link rel="icon" type="image/jpeg" href="http://www.example.com/image.jpg"> <!-- For good browsers. -->
<link rel="SHORTCUT ICON" href="http://www.example.com/alternateimage.ico"/> <!-- For Internet Explorer-->
And similiarly for png and gif.
I hope that helps
What are the 3 tools which dont implement favicons correctly?
It is really nice written article from you guys. I would suggest it to everyone who wants to read and learn more. There is so many helpful information’s which I couldn’t find on other websites and other similar blogs. Thank You for letting us know more about php.