0

I am using following code to display favicon.ico:

<link rel="shortcut icon" type="image/x-icon" href="https://{domain}/res/202009100200/images/favicon/en/favicon.ico"/>

Using this URL favicon.ico loads correctly. But Chrome does not show any favicon and if I inspect via Development console I realize it tries to load favicon from site's root (where it obviusly does not exist).

Why is Chrome trying to find favicon in site's root instead of the location I provide? In Firefox and Edge it works.

michal.jakubeczy
  • 8,221
  • 1
  • 59
  • 63
  • Just put it in the default locatjon. It's not a good idea not to. https://stackoverflow.com/a/21359390/9436078 – LFYG Sep 10 '20 at 08:21
  • I am determining favicon according to many parameters so that's the reason I need two favicons in different folders. – michal.jakubeczy Sep 10 '20 at 08:23
  • @michal.jakubeczy please check this refrence https://stackoverflow.com/questions/24300856/favicon-is-not-showing-if-the-url-starts-with-https – Neeraj Amoli Sep 10 '20 at 08:38

2 Answers2

-1

you can use this code

<link rel="icon" href="icon.gif" type="image/gif" sizes="16x16">

It is working when I use

-1

Most of time browser use the favicon location as root directory not the directory specified in href attribute. Try to Putting favicon at root directory.

I all refer to go to this Favicon location ignored by chrome an already active question with many answers hope it help.

  • So what is the purpose of href attribute if it is ignored? – michal.jakubeczy Sep 10 '20 at 09:06
  • it does ignore but not every time i have an website [link](https://openlibrary.site) i also have placed my favicon at a subdirectory "root/img/favicon.ico" but it works fine. it does matter of browser(try to upgrade to new one) –  Sep 11 '20 at 11:23