2
votes

Hello!

The issue is that the favicon does not appear when http redirect is active in IIS 8.5. My OS is windows server 2012 r2, the web browser is IE11.

What I do: I go to IIS 8.5,click on http redirection, check the first option, enter the http link and then apply. Run iisreset, clear IE cash, reload the page. The favicon.ico is in wwwroot folder.

What I've tried:

-Add mime type in IIS (".ico" = "image/x-icon" or ".ico" = "image/vnd.microsoft.icon")

-Add link in the page (link rel="icon" type="image/x-icon" href="/favicon.ico")

-Different icon generated by a web site.

Please help me!

Thanks

**[EDIT]**

This is how redirect is set in IIS:

--------------------------------
HTTP Redirect

Use the feature to specify rules for redirecting incoming requests to   antoher file or URL.

V Redirect requests to this destination :
    http://[dnsname]/[folder]/

Redirect Behavior

V Redirect all requests to exact destination (instead of relative to  destination)

Only redirect requests to content in this directory (not subdirectories)

Status code :

Found (302)

---------------------------------

In the source page, it's same thing if I add or delete the link tag to the icon.
<html>
   <head>
      <link rel="icon" type="image/x-icon" href="/favicon.ico">
   <head>
<html>
1
can you access the favicon using its absolute url? e.g. http: //www.yourwebsite.com/favicon.icoMirko Lugano
Yes but only when Http redirect is off.UnBoug
How is the redirect set (from - to)? Does it stay on the same domain and/or directory? My guess is that all requests get redirected, (including the favicon) so the favicon might have a wrong url. Did you check the source code of the page?Mirko Lugano
Ok. It works wonderfully well in IIS 6.0! Another weird thing, the icon preview in wwwroot folder is always the same one, even if I change the icon...Works in windows server 2003.UnBoug
I still didn't get it 100% but I think that all requests to your site root get redirected (including the favicon). Do you need to do the redirect within IIS? Couldn't you just place a javascript redirect? window.location.href = 'new url'Mirko Lugano

1 Answers

4
votes

Ok I found a solution. Just put below code in the web.config in the wwwroot directory.

<configuration>
    <location path="favicon.ico">
        <system.webServer>
            <httpRedirect enabled="false" />
        </system.webServer>
    </location>
</configuration>

Thanks to Mirko Lugano for his help and put me on the right track!