Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesnt browser show favicon after deployment

I have a asp.net mvc web application an it uses some favicon.ico. Now when I move it to IIS 7, as an application, the favicon stops being presented even when I try to enter the full address to the favicon. The icon is still there; the full address works in the browser to find the icon alone, but not within the applications master page. The code is standard and same as on some others of my apps, but there it works.

<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
    <link rel="shortcut icon" href="../../Content/Images/favicon.ico" />
    <link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../../Scripts/Site.js"></script>
</head>

Any ideas why this might be?

like image 852
Trimack Avatar asked Jan 04 '10 11:01

Trimack


2 Answers

try changing your link tag to:

<link rel="shortcut icon" href="/Content/Images/favicon.ico" type="image/x-icon" />
like image 117
tster Avatar answered Sep 29 '22 01:09

tster


Browsers are very finicky about favicons. They will not always retrieve them on a refresh and oftentimes they will skip them at will.

The best approach is to place your favicon in your document root so that tthe link is /favicon.ico. Also make sure it is a real Microsoft format .ICO icon file. Looking it up through a path with parent directories .. - like you do here - is asking for problems.

There is no formal cross server and browser standard, for more information see: http://en.wikipedia.org/wiki/Favicon

like image 43
Matijs Avatar answered Sep 29 '22 03:09

Matijs