Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What if the favicon is not named favicon.ico?

Tags:

html

favicon

w3c

Are there any restrictions on naming the favorites icon (favicon) file as anything other than favicon.ico?

I know for sure that it can be named anything, as long as the favicon tag refers to the correct file name.

For example:

<link href="/somefile.ico" type="image/x-icon" rel="icon" />
<link href="/somefile.ico" type="image/x-icon" rel="shortcut icon" />

The code above works just fine in displaying the icon.

What I want to know is does this violate any W3C/HTML specifications or this is permitted usage?

like image 357
miCRoSCoPiC_eaRthLinG Avatar asked Apr 17 '11 04:04

miCRoSCoPiC_eaRthLinG


People also ask

Does a favicon have to be named favicon ICO?

I know for sure that it can be named anything, as long as the favicon tag refers to the correct file name. The code above works just fine in displaying the icon.

How do I fix favicon ICO?

In my case, it was fixed by moving the favicon. ico to the same place as my Html file. Obviously, you should change the icon path too.

What is favicon ico not found?

Most browsers look for the existence of an file called favicon. ico at the root path of your website domain, this controls the icon for the website you can see in your bookmarks folder or the address bar of your browser. If you don't have one, then it's valid that it would return a Not Found error.

How do I add a favicon to ico?

To add a favicon to your website, either save your favicon image to the root directory of your webserver, or create a folder in the root directory called images, and save your favicon image in this folder. A common name for a favicon image is "favicon.ico".


1 Answers

According to W3C, the preferred method is to actually specify the favicon in the html document rather than relying on favicon.ico in the server root.

like image 174
Zach Johnson Avatar answered Oct 11 '22 19:10

Zach Johnson