: Favicon 404 in access log, but favicon is there Going through 404 error on my site, I have noticed a bunch of problems with favicons: /apple-touch-icon-120x120.png /apple-touch-icon-120x120-precomposed.png
Going through 404 error on my site, I have noticed a bunch of problems with favicons:
/apple-touch-icon-120x120.png
/apple-touch-icon-120x120-precomposed.png
/apple-touch-icon-152x152.png
/apple-touch-icon-152x152-precomposed.png
/apple-touch-icon-precomposed.png
/apple-touch-icon.png
/favicon.ico
Interesting part is that I have the following code on every page
<link rel="shortcut icon" href="/public/img/favicon.ico">
<link rel="apple-touch-icon image_src" href="/public/img/apple-big.png">
But I see that sometimes in the logs I see "GET /public/img/favicon.ico HTTP/1.1" 200 which means that icon is taken from correct location, but sometimes "GET /favicon.ico HTTP/1.1" 404.
I searched through the whole codebase trying to find where else favicon could be called, but with not luck. Any idea what might be wrong?
P.S. added user agents: "GET /favicon.ico HTTP/1.1" 404 409 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0"
More posts by @Lee4591628
1 Comments
Sorted by latest first Latest Oldest Best
It would be worth looking at the user-agent values for those requests causing the 404's. As previously asked/answered, browsers will normally follow the <link> location before any default request is made against the root folder of the site.
The error logs you are seeing are due to your file locations being in other directories. Most browsers will find them as they've parsed your HTML and located the appropriate <link> declaration, but others may not.
[EDIT/UPDATE FOR EXPLICIT ANSWER]
Move or redirect requests for your icons to the root folder so that the following resolve:
<link rel="shortcut icon" href="/favicon.ico">
<link rel="apple-touch-icon image_src" href="/apple-touch-icon-precomposed.png">
Then add/provision for the other requests as outlined here.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.