IIS 8.5 HTTP 重定向 VS Favicon

标签 iis favicon http-redirect

你好!

问题是当 IIS 8.5 中的 http 重定向处于事件状态时,网站图标不会出现。 我的操作系统是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”)

-在页面中添加链接(link rel="icon"type="image/x-icon"href="/favicon.ico")

-网站生成的不同图标。

请帮助我!

谢谢

**[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>

最佳答案

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

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

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

关于IIS 8.5 HTTP 重定向 VS Favicon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28631579/

相关文章:

asp.net - 在 web.config 文件中设置重定向

php - 302重定向到非HTTP协议(protocol)

asp.net - 对 ASP.NET 并发请求进行基准测试结果不佳

iis - 将静态内容重写到 IIS 中的不同域

visual-studio - 调试时Microsoft Edge提示进行身份验证

windows - 在 windows/IIS symfony2 中为 CoffeeScript 设置 assetic 过滤器

html - 如何为网站添加浏览器标签图标(favicon)?

reactjs - 将 Favicon.ico 添加到 Contentful 或 Gatsby 网站

r - 使用开源 Shiny 服务器时,我的图标不会显示在我的应用程序的浏览器选项卡上

rest - 嵌入式 Jetty : In secure https server, ContextHandler 重定向到 http URI