If you put favicon.ico in another directory and declare it in HTML (for example, <link rel="shortcut icon" href="/icon/favicon.ico"> ) , favicon will work , including on IE5, the first Browser for icon support. However, you will encounter the following (minor) disadvantages:
- IE (and perhaps some others) will look for
/favicon.ico no matter what. Expect 404 errors in the logs of your HTTP server. - Some browsers, such as Chrome, will use
favicon.ico , even if you also declare high resolution PNG images favicon. Of course, if you use favicon.ico only as an icon, this is not a problem.
In general, it is good practice to put the entire favicon-related file in the root directory of the website. For more details see http://realfavicongenerator.net/faq#why_icons_in_root (full disclosure: I am the author of this page).
source share