miCRoSCoPiC_eaRthLinG
miCRoSCoPiC_eaRthLinG

Reputation: 2960

What if the favicon is not named favicon.ico?

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?

Upvotes: 11

Views: 6846

Answers (1)

Zach Johnson
Zach Johnson

Reputation: 24232

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.

Upvotes: 17

Related Questions