0

Favicon icon is showing at chrome, mozilla firefox and i tried other browsers too but it is not showing in IE 9. I am unable to locate where the problem is.

I pasted the code below inside head tag inside MasterPage(using Visual Studio)

<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />
    <title>DemoPage</title>
    <link href="css/patrika.min.css" rel="stylesheet" />

    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>

But favicon is still not shown in IE 9. Is there any other way to do it.. or i am doing something wrong because it works very well on other browsers - chrome,firefox..

Matt Busche
  • 14,216
  • 5
  • 36
  • 61
Vedank Kulshrestha
  • 220
  • 1
  • 6
  • 23
  • try copying favicon.ico into the root of your website (rather than the subfolder images) and it should work automagically ;o) – Luke Baughan Mar 18 '13 at 09:16
  • Pretty sure favicons are expected in the root, never tried to override this personally. And in that case, you don't even need a hard reference. – Grant Thomas Mar 18 '13 at 09:17
  • i tried to put inside the root directory, it didn't works..! :( – Vedank Kulshrestha Mar 18 '13 at 09:19
  • 1
    possible duplicate of this question http://stackoverflow.com/questions/12739918/how-do-you-allow-a-fav-icon-to-show-in-all-versions-of-ie http://stackoverflow.com/questions/122067/favicon-not-working-in-ie you could also check things links. This could also help you :). – bot Mar 18 '13 at 09:26
  • There used to be an IE "feature" that it only showed favicons for *bookmarked* sites. I don't know if that still applies? – Hans Kesting Mar 18 '13 at 09:35
  • This thread [favicon not showing in IE8](http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/a6fb09ef-aa3e-4e9e-be44-edbfad322657/) may be useful – chridam Mar 18 '13 at 10:20

5 Answers5

3

For the most consistent results, use an absolute path to the favicon.ico file in your domain root folder:

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

Other cases you have to check as well are: 1. Are you renaming a jpg to ico? If so, create the file as an ico and it will wok as expected. 2. If the site is a closed one and requires log in, the icon will not be displayed. Add an exception for the favicon.ico in the web.config:

<location path="favicon.ico">
  <system.web>
     <authorization>
       <allow users="*" />
     </authorization>
  </system.web>
</location> 
chridam
  • 100,957
  • 23
  • 236
  • 235
  • 1
    Your parenthetical remark could be handled implicitly by: ` – Grant Thomas Mar 18 '13 at 09:21
  • 1
    Or a [protocol-less URL](http://stackoverflow.com/questions/4831741/can-i-change-all-my-http-links-to-just) - `href="//yourdomain/favicon.ico"` should cater for both – andyb Mar 18 '13 at 09:23
1

Look at the acces log file of your webbrowser. You can actually see where the various browsers do look for a favicon.ico file, then put it there were IE9 is looking for it.

Some browsers were notoriously hard to trigger re-reading the favicon.ico file if they had not done so on first try. So make sure you see that it is trying to retrieve, including restarting the browser and if necessary clearing its cache.

Anthon
  • 69,918
  • 32
  • 186
  • 246
1

Well guys! Thanks for your answer and support!!

I got the solution now We have to add like this inside head tag

<link rel="shortcut icon" href="~/favi.ico" type="text/x-html-insertion" />

Favicon is now working in IE 9 too. Hope this will going to helpful at your end in future as well.

Vedank Kulshrestha
  • 220
  • 1
  • 6
  • 23
0

Use full path for icon

<link rel="shortcut icon" href="http://www.yourdomain.com/images/favicon.ico" type="image/x-icon" />
Teejay
  • 7,210
  • 10
  • 45
  • 76
-1

Just refresh the page or delete the cache and refresh it there is no difference between browsers for favicon.

gsmida
  • 357
  • 1
  • 5
  • 15