![](/img/trans.png)
[英]Web Page Not Found - HTTP 404, ASP.NET page isn't working with IIS7.5
[英]IIS 7.5 404 not found for all images via one of the http bindings
我在IIS 7.5 / Windows Server 2008 R2上有ASP.NET MVC網站。 網站具有一組到不同域的http綁定,例如domain1.test.dev.com。 domain2.test.dev.com,總共10個綁定。 除了一個,他們都做得很好。 對圖像的每個請求(jpg,gif,png)都將為此綁定返回404。 因此,整個布局已加載,所有其他請求都感覺良好,但是所有圖像都被破壞,錯誤404未找到。 沒有https綁定,它們都使用http,端口80,並且IP地址為“所有未分配”。 有人可以幫忙嗎?
找到答案。 〜/ Images目錄中還有一個附加的web.config文件。 該配置包含其中一個域的特定重定向規則,因此對於該域,我看到了404,而其他域則表現出色。 由於在IIS上的URL重寫模塊中未單擊,因此意外地在〜/ Images目錄中出現了另一個web.config。 不久前,我們已將此類重定向用於演示,然后將其刪除。 web.config中的重定向規則是以下一種:
<system.webServer>
<rewrite>
<rules>
<rule name="ProductionRedirectDomain1" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{CACHE_URL}" pattern="*domain1.test.dev.com*" />
</conditions>
<action type="Redirect" url="{C:1}domain1.com{C:2}" />
</rule>
</rewrite>
</system.webServer>
刪除冗余配置后,該錯誤已消失。 謝謝大家!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.