This blog contains reflections and thoughts on my work as a software engineer

fredag den 1. april 2011

How to place favicon.ico outside the root folder of your website

I always hated being forced to have favicon.ico  (the little icon in your browser’s address bar) in the root folder of the websites I’ve been working on. It’s just plain ugly having content files in the root of anything because basicly: It doesn’t belong there and makes any webproject look bad… Right until now I never thought that this could be costumized but today I googled and found a neat solution: Just place the following tag in your HEAD-section:

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

This tells your browser that it should go get the icon from /content/favicon.ico instead of checking the root of your website. According to Wikipedia this solution is also crossbrowser compatible. I just loooooove discovering little bits and pieces that makes annoying files disappear…

Regards K.