IIS 8.5 HTTP重定向VS Favicon

时间:2015-02-20 14:41:07

标签: iis favicon http-redirect

您好!

问题是,当http重定向在IIS 8.5中处于活动状态时,不会显示favicon。 我的操作系统是windows server 2012 r2,网页浏览器是IE11。

我做什么: 我转到IIS 8.5,单击http重定向,检查第一个选项,输入http链接然后应用。运行iisreset,清除IE现金,重新加载页面。 favicon.ico位于wwwroot文件夹中。

我尝试过的事情:

- 在IIS中添加mime类型(" .ico" =" image / x-icon"或" .ico" =" image / vnd .microsoft.icon&#34)

- 在页面中添加链接(link rel =&#34; icon&#34; type =&#34; image / x-icon&#34; href =&#34; /favicon.ico")< / p>

- 网站生成的不同图标。

请帮助我!

由于

**[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 个答案:

答案 0 :(得分:3)

好的,我找到了解决方案。只需将以下代码放在wwwroot目录中的web.config中即可。

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

感谢Mirko Lugano的帮助,让我走上正轨!