【发布时间】:2016-04-27 09:26:23
【问题描述】:
当我在我的应用程序中收到 403 错误时,我正在尝试重定向到 html 文件。这是由 IIS 处理的,所以我已将其添加到我的 Web 配置中:
<httpErrors errorMode="Custom" >
<remove statusCode="403"/>
<error statusCode="403" responseMode="File" path="/500.html"/>
</httpErrors>
这给了我这个错误:
You do not have permission to view this directory or page.
但是,如果我将响应模式更改为ExecuteURL,它将重定向到页面。但它会显示 200 的 http 状态代码,而文件将保留 403 错误。我就是无法让它重定向到这个文件。
谁能帮我解决这个问题?
【问题讨论】:
标签: redirect iis web-config http-error