Why isn't my favicon showing up?

2019-06-16 17:30发布

Alright, so my favicon isn't showing up for some reason. It's at image/favicon.ico (I've checked like 5 times).

This is the code I use for it:

<link rel="shortcut icon" href="images/favicon.ico" />  

And this is the site: http://prime.programming-designs.com/

Edit: alright, I guess it's just my cashe.

6条回答
贼婆χ
2楼-- · 2019-06-16 17:32

Most browsers like IE will request /favicon.ico despite what you have set, but it should still work if you return the proper Content-Type and made it the right way.

You can attempt to do:

<link rel="shortcut icon" href="/images/favicon.ico?289349832" /> 

The query string usually forces the browser to re-request the resource since it's unique.

You can also attempt to do a server redirect from /favicon.ico to /images/favicon.ico

You can also just move /images/favicon.ico to the root.

However, browsers naturally really, really cache the crap out of favicons so my suggestion would be to wait, as most likely none of the above would help. In time it should show up on your browser.

查看更多
Evening l夕情丶
3楼-- · 2019-06-16 17:47

Remove the cache of your browser and reboot the browser. Might take a while to show up in for example FF

查看更多
看我几分像从前
4楼-- · 2019-06-16 17:48
  1. Load up http://prime.programming-designs.com/images/favicon.ico in your browser to 100% verify that the path is correct.
  2. Check the Content-Type header returned by the server. Some browsers might be oversensitive. You may have to register the MIME type for the .ico extension.
  3. As others have said, try clearing the browser cache.
查看更多
smile是对你的礼貌
5楼-- · 2019-06-16 17:53

It's probably just cached in your browser, it shows up as a blue cross on mine.

Else, check your image path. image/favicon.ico isn't matching images/favicon.ico, but that is probably just a typo.

查看更多
欢心
6楼-- · 2019-06-16 17:57

I just renamed favicon to favicon1 and uploaded the changed files and it worked.

查看更多
Emotional °昔
7楼-- · 2019-06-16 17:58

Late, however. I run into this problem more than I should. My fix is to add a 'version number' ?v1 or whatever, this will blow away cache.

<link rel="icon" href="favicon.ico?v1" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico?v1" type="image/x-icon" /> 
查看更多
登录 后发表回答