【问题标题】:IIS 7.5 set redirect error page but return http 500.22 errorIIS 7.5 设置重定向错误页面但返回 http 500.22 错误
【发布时间】:2018-05-04 12:47:12
【问题描述】:

在 IIS 7.5 服务器上有两个站点 每个站点都有相同的错误页面,一个运行,一个不运行。 两者都具有相似的 web.config 结构,并且服务器设置没有显着差异。两个管道都通过相同的集成进行了同等集成。 我在谷歌上搜索并做类似↓的事情,但它没用。 我们该如何解决? 下面的代码显示了两个站点上 web.config 文件的相同设置。

<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
  <add type="te.test, Version=1.1.1.0" name="testModule" />
</modules>
<httpErrors errorMode="Custom">
        <error statusCode="404" prefixLanguageFilePath="" path="/error_page/error_test.html" responseMode="ExecuteURL" />
        <error statusCode="500" prefixLanguageFilePath="" path="/error_page/error_test.html" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>

<system.web>
<customErrors defaultRedirect="http://test.test/error_page/error_test.html" mode="On">
</customErrors>
</system.web>

【问题讨论】:

  • 不清楚你想问什么。
  • 我有两个站点,每个站点都有相同的 IIS 设置,web.config 结构,并设置重定向相同的错误页面设置,但一个是激活另一个不是..
  • 您需要添加详细信息,例如您如何尝试重定向到错误页面。您在此处编写的代码没有显示任何重定向
  • 感谢您的意见,所以我修改了内容并添加了几个代码。
  • 您还需要使用&lt;customerrors&gt; 标签。然后您的网站每次都会重定向到正确的错误页面。

标签: asp.net http web-config iis-7.5 http-status-code-500


【解决方案1】:

问题是虚拟目录(/error_page) 我将虚拟目录配置为“应用程序”

【讨论】:

    猜你喜欢
    • 2014-05-14
    • 2015-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多