Do I need to have a favicon on my site? How do I get rid of the errors I see in my apache log?

后端 未结 7 1221
余生分开走
余生分开走 2021-02-18 21:48

I keep seeing favicon warnings in my apache log. How do I get rid of those? Do I have to have a favicon for my site?

7条回答
  •  爱一瞬间的悲伤
    2021-02-18 22:01

    Looking at your logs, you will probably see such 404 errors:

    • favicon.ico: Internet Explorer, Chrome...
    • apple-touch-icon.png: iOS devices, Android, maybe some other devices
    • apple-touch-icon-precomposed.png: iOS devices, Android, maybe some other devices
    • apple-touch-icon-76x76.png: iOS, maybe some other devices
    • apple-touch-icon-120x120.png: iOS, maybe some other devices
    • apple-touch-icon-152x152.png: iOS, maybe some other devices

    If you absolutely don't want to add a favicon to your site, you can apply one the the solution described in the other answers:

    • mod_rewrite
    • Force 404
    • Empty picture

    However, favicon are so common nowadays that you probably want to add one to your site. This favicon generator creates all these files at once. Full disclosure: I am the creator of this site.

提交回复
热议问题