According to this answer it looks like it should be rel="icon"
instead of rel="shortcut icon"
.
Also, if your favicon.ico
is at the root of your server http://example.com/favicon.ico
and your page is in a subdirectory http://example.com/blog/
, the browser will try searching for favicon.ico
inside the current directory http://example.com/blog/favicon.ico
, which would result in a 404 error; to avoid that, you should set href="/favicon.ico"
so it always points to the root directory, no matter in what subdirectory you are.