How do I set the icon of a website other than what it's named favicon.ico?

I don't like hardcoding.

+2


source to share


2 answers


Look at the source of this page:



<link rel="shortcut icon" href="http://sstatic.net/so/favicon.ico" >

      

+8


source


rel = "shortcut icon" is good, but in the end it is possibly sterile. I don't like hardcoding either, but we're stuck with it.

You cannot link to a non-HTML entity (such as directly viewing an image) or error pages that you do not fully control. And sometimes browsers seem to get the favicon anyway, ignoring the link. This way your server error logs will still fill up with pointless 404 errors for /favicon.ico even if you change the path.



Thanks Microsoft, would it be too much to only ask for icons from sites that contain a link? And now we have a twofold problem: Apple also insists on extracting / apple -touch-icon.png, despite no indication that such a file may exist. You companies are trash. Garbage, I'll tell you!

+2


source







All Articles