Favicon not showing up

守給你的承諾、 提交于 2019-12-17 23:09:12

问题


I placed my favicon here:

http://www.vittoriosastarsnursery.com/favicon.ico

But for some reason it doesn't want to show in Firefox. It did work in IE, but I'm more concerned about getting it working in Firefox.


回答1:


I can see it in Chrome, Firefox, and IE. My friend had a problem like this when we were testing back in college. It was just a weird caching thing that made her think it wasn't working right. I'm sure that everyone besides you will be able to see that it works fine. You could always try restarting your browser after clearing the cache and see if that helps.




回答2:


Suddenly I found answer here

You should add "?" to your favicon path and it works! Even with path such as images/favicon.ico. Just try:

<link rel="icon" href="/images/favicon.ico?" type="image/x-icon">

Other browsers works too.

Remember to restart mozilla, because of it's own cache, that is not connected with css and other caching.

updated:

Another way is set redirect from favicon.ico to /images/favicon.ico (301 works)




回答3:


Two things to consider

  • If it's working in some browsers and not in others it's likely going to be a cache issue. Clear your cache and refresh, or for more in depth info: How do I force a favicon refresh
  • If favicon.ico is in the project's root folder but not being recognized by any browsers I would check out the .htaccess, or whatever equivalent of .htaccess depending on server type etc.



回答4:


<link rel="icon" href="http://khachmeruk.com/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="http://khachmeruk.com/favicon.ico" type="image/x-icon"> 



回答5:


For those who suffer from this problem, try move your favicon file to home directory. It worked for me and solved my problem.




回答6:


If you don't want to spend hours. trying to figure out why your favicon is not showing up, make sure to always place it in the root of your project folder and add a link in the <head></head> section of your page like so:

<head>
  //other code
  <link rel="icon" href="favicon.ico" type="image/x-icon">
  //other code
</head>

Folder Structure

--app
-----img
-----js
-----css
-----favicon.ico



回答7:


It works for me in FireFox. When running identify (part of the ImageMagick package), it reports this problem: identify: invalid colormap index 'favicon.ico' @ error/image.c/SyncImage/3906

Perhaps opening the file in a graphics editor and re-saving it would clean up this error.




回答8:


I had this problem too. it turns out (for me at least) that blocking users / agents with no referrer via .htaccess caused the problem.




回答9:


It is just a caching issue. Just change the file name and it will show up immediately... otherwise do nothing and it will show up eventually. Browsers are just very persistent with the favicon caching.




回答10:


For those who have tried everything and the favicon still does not show up:

  1. Put it in your sites Root Directory
  2. Rename it "favicon.ico"
  3. Make sure your code is like such:

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

    1. IF you still have the same problem, put the whole website in ANOTHER DIRECTORY, like a Memory Stick (that fixed it for me :) ).

    2. REMEMBER: You HAVE to put the icon code in the of EVERY page. :)



来源:https://stackoverflow.com/questions/7324456/favicon-not-showing-up

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!