Reputation: 431
I need to put favicon.ico outside the root of the web site. Can i place it in another path or it may penalize some old browser?
Upvotes: 11
Views: 15491
Reputation: 41418
If you put favicon.ico
in another directory and declare it in the HTML (eg. <link rel="shortcut icon" href="/icon/favicon.ico">
), the favicon will work, including on IE5, the first browser to support favicons. However, you will encounter the following (minor) drawbacks:
/favicon.ico
no matter what. Expect some 404 errors in your HTTP server logs.favicon.ico
even if you also declare high resolution PNG favicon pictures. Of course, if you only use favicon.ico
as the favicon picture, this is not a concern.In general, this is a good practice to put all favicon-related file in the root directory of the web site. See http://realfavicongenerator.net/faq#why_icons_in_root for more information (full disclosure: I am the author of this page).
Upvotes: 17
Reputation: 2114
Some browsers will always check for favicon.ico in the root folder. Won't break anything if absent, though.
Upvotes: 3