IIS 8.5 HTTP重定向与Favicon

IIS 8.5 HTTP重定向与Favicon,iis,favicon,http-redirect,Iis,Favicon,Http Redirect,你好 问题是,当IIS 8.5中http重定向处于活动状态时,favicon不会出现。 我的操作系统是windows server 2012 r2,web浏览器是IE11 我所做的: 我转到IIS8.5,单击http重定向,选中第一个选项,输入http链接,然后应用。运行iisreset,清除IE cash,重新加载页面。favicon.ico位于wwwroot文件夹中 我所尝试的: -在IIS中添加mime类型(“.ico”=“image/x-icon”或“.ico”=“image/vnd.m

你好

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

我所做的: 我转到IIS8.5,单击http重定向,选中第一个选项,输入http链接,然后应用。运行iisreset,清除IE cash,重新加载页面。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>
**[编辑]**
以下是在IIS中设置重定向的方式:
--------------------------------
HTTP重定向
使用该功能可指定将传入请求重定向到其他文件或URL的规则。
V将请求重定向到此目标:
http://[dnsname]/[folder]/
重定向行为
V将所有请求重定向到确切的目标(而不是相对于目标)
仅将请求重定向到此目录(而不是子目录)中的内容
状态代码:
发现(302)
---------------------------------
在源页面中,如果我添加或删除图标的链接标签也是一样的。

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

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


感谢米尔科·卢加诺的帮助,让我走上了正确的道路

你能使用favicon的绝对url访问它吗?e、 g.http://www.yourwebsite.com/favicon.icoYes,但仅当http重定向关闭时。如何设置重定向(从-到)?它是否保留在同一个域和/或目录中?我的猜测是,所有请求都会被重定向(包括favicon),因此favicon可能有一个错误的url。你检查过页面的源代码了吗?好的。它在IIS 6.0中运行得非常好!另一件奇怪的事情是,wwwroot文件夹中的图标预览总是相同的,即使我更改了图标…在windows server 2003中工作。我仍然没有100%得到它,但我认为所有对站点根目录的请求都会被重定向(包括favicon)。您需要在IIS中执行重定向吗?你就不能放一个javascript重定向吗?window.location.href='新url'