【问题标题】:App_Offline -> 404 ErrorApp_Offline -> 404 错误
【发布时间】:2014-03-27 00:54:05
【问题描述】:

只需将名为 app_offline.htm 的文件放在站点的根目录中,ASP.NET 就会提供 app_offline.htm 文件,而不是请求的页面。我最近可能是第一次使用此功能。我将 app_offline.htm 文件放在网站上,然后在 Firefox 中打开我的网站。 app_offline.htm 的内容按预期显示。但是,如果我在 IE 中拉出我的网站,我会收到一个找不到页面的错误,看起来好像我的整个网站都不存在。操作系统是 Windows Server 2008 R2 – IIS 7.5
他是什么问题,我该如何解决?我希望有人可以帮助我,

谢谢霍斯特

【问题讨论】:

    标签: iis iis-7 iis-7.5 app-offline.htm


    【解决方案1】:

    您的 app_offline.htm 有多大(以 字节 为单位)?

    如果我没记错的话,对于 IE,有一个怪癖要求此文件必须达到一定的最小大小才能被识别(512 字节)。

    在 Scott Gu 的博客上了解更多信息:App_Offline.htm and working around the IE Friendly Errors feature

    【讨论】:

      【解决方案2】:

      这对我有用。 我创建了一个包含以下内容的新网站: 该网站有 448 字节。

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0     Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
       <html xmlns="http://www.w3.org/1999/xhtml" >
      <head>
      <title>Errorpage</title>
          <meta http-equiv="REFRESH" content="0;url=http://error/index.html" >
      </head>
       <body>
              <script language="javascript" >
               window.location = "http://error/index.html";
             </script>
       !!Errorpage!!
       </body>
       </html>
      

      谢谢, 霍斯特

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-03-18
        • 2018-06-20
        • 2011-07-04
        • 2016-10-24
        • 2018-06-04
        • 2013-03-13
        相关资源
        最近更新 更多