Why does my favicon not show up?

Sivajith picture Sivajith · Mar 16, 2013 · Viewed 103.9k times · Source

The following is used to set the favicon in my html code:

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

However, the icon does not show. Why?

Note:

I have confirmed that the file is on-disk at the correct path.

Answer

Rich Bradshaw picture Rich Bradshaw · Mar 16, 2013
  1. Is it really a .ico, or is it just named ".ico"?
  2. What browser are you testing in?

The absolutely easiest way to have a favicon is to place an icon called "favicon.ico" in the root folder. That just works everywhere, no code needed at all.

If you must have it in a subdirectory, use:

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

Note the / before img to ensure it is anchored to the root folder.