1

The favicon isn't working on my site. If I go to google.com/favicon.ico I see the image displayed. But for some reason on my site, lucasjohnson.co.uk/favicon.ico prompts me to download a file. I have even tried replacing my own favicon with Google's, but I still have the same problem.

Edit: The file ico file was converted from a png using Dynamic Drive's FavIcon Generator.

Adam Ulivi
  • 85
  • 1
  • 11

1 Answers1

1

I checked http://www.lucasjohnson.co.uk/favicon.ico, and the response content-type is text/plain. There are several content types that can be used for favicon, but text/plain is not one of them.

The most common ones are image/x-icon and image/vnd.microsoft.icon.

So basically, just choose one of the following content types and add it to your link tag:

<link rel="icon" type="image/vnd.microsoft.icon" href="http://www.lucasjohnson.co.uk/favicon.ico" />
<link rel="icon" type="image/png"                href="http://www.lucasjohnson.co.uk/favicon.ico" />
<link rel="icon" type="image/gif"                href="http://www.lucasjohnson.co.uk/favicon.ico" />
<link rel="icon" type="image/x-icon"             href="http://www.lucasjohnson.co.uk/favicon.ico" />

See http://en.wikipedia.org/wiki/Favicon for more details.

BTW, regardless (or not) of this problem, I've noticed that you're not closing one of your meta tags:

<meta name="viewport" content="width=device-width">
barak manos
  • 29,648
  • 10
  • 62
  • 114
  • Is this favicon.ico file a _true_ ICON format image, or did you rename some other formatted image? It's quite unusual for a server to have trouble serving a favicon.ico file. – Phil Perry Jan 31 '14 at 17:53
  • If you need to convert your image to an actual ico format there are several free online converters a simple google search can find, also some image editors do support export to ICO format. – tremor Jan 31 '14 at 17:55
  • I converted it from PNG with a FavIcon Generator. I still can't get it to work. – Adam Ulivi Jan 31 '14 at 18:57
  • I'm looking into your web-page source - now you forgot to close the favicon's `link` tag. – barak manos Jan 31 '14 at 19:08
  • Well spotted. I've closed that now. Still, I don't think it's a problem with the code because I can't even load the ico file when I browse to the URL – Adam Ulivi Jan 31 '14 at 19:42