سؤال

Google Reader does not display the icon for my Atom feed http://feeds.feedburner.com/CartesianClosedComic.

Here's what I tried, based on various suggestions found on the internet:

  • Added an <icon> element that points to a png icon. (I also tried an .ico icon there.) IMO, this by itself should be sufficient, but for some reason it isn't.
  • Added a <link rel="shortcut icon" type="image/x-icon" /> element pointing to an .ico icon, by analogy with ordinary pages.
  • Added a <link rel="alternate" type="text/html" /> element pointing to a webpage that has a favicon.

None of the above helped.

I also found a hypothesis that one should have a favicon under the domain's root path (something like http://mydomain.com/favicon.ico), but that's not an option for me.

هل كانت مفيدة؟

المحلول

Google Reader uses URLs of the form http://s2.googleusercontent.com/s2/favicon?domain_url=http://domainname/foo/bar/baz.html to cache site favicons. I have verified that their cache service makes a single request to fetch http://domainname/favicon.ico and nothing more; it does not matter if you provide a URL for a specific page — that page never gets requested, so any favicon specified within it will not be taken into account.

The bad news is that the only way to affect that favicon cache service is to actually serve a favicon for the /favicon.ico URL. The good news is that you don't have to serve an actual Windows Icon file at that URL; a PNG image located at that URL works just fine.

If you're unable to host an actual /favicon.ico file on your server, you might be able to set up some sort of redirection or URL rewriting in order to provide a favicon hosted somewhere else. I have tested it and can confirm that Google will follow redirects, even to off-site URLs, so you don't even have to host the favicon on the same domain. Still, more bad news: Google does not bother to send an User-Agent header with that request, so you cannot set up a conditional redirect only for their favicon cache. All requests in my tests came from the 74.125.18.0/24 network, so you might be able to implement a conditional redirect based on that.

I see that you're hosting your feed content in a /ccc subdirectory on your site, and you're probably unwilling to place your comic's favicon as your site-wide favicon. I also see that your hosting provider offers at least 10 subdomains (I have no idea which package you're using, but that's for their lowest offering), so you could create a subdomain on your site (say, ccc.ro-che.info) and use that as the URL of your feed. Google will try to fetch http://ccc.ro-che.info/favicon.ico for the feed and you can set up a specific favicon resource only on that subdomain. You can also set up a redirect from http://ccc.ro-che.info/* to http://ro-che.info/ccc/*, so that your comic remains at its present position, and everybody coming from a feed link will also be redirected to the current location of the resource.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top