SharePoint and the favicon

Setting a page’s favicon is pretty easy in 2010:

 <SharePoint:SPShortcutIcon runat="server" IconUrl="/_layouts/images/favicon.ico"/>

Now try this with an icon coming from the Style Library:

 <SharePoint:SPShortcutIcon runat="server" IconUrl="/Style Library/favicon.ico"/>

You think you have nailed it, right? Fire up IE8 running on XP and you’ll see it won’t appear.

Here’s the fix:

 <SharePoint:SPShortcutIcon runat="server" IconUrl="/Style%20Library/favicon.ico"/>

Took me some time to figure out…