我正在尝试处理我的Web应用程序中的403和404错误。我已经阅读了微软的说明并在我的服务器上应用了。通过编辑我的web.config,IIS7管理器有效地处理了这个问题:
它可以处理像http://www.mysite/fictiousURL.aspx这样的请求,但无法处理http://www.mysite/fictiousURLTest.html。它似乎只能处理aspx请求。
我还尝试了http://www.15seconds.com/issue/030102.htm,通过在system.web节点中添加此配置
有人知道a)为什么IIS7只处理aspx,b)有人知道如何处理通用请求,例如http://www.mysite/fictiousURLTest.html吗?
谢谢,比尔N
<httpRedirect enabled="false" destination="/MySite" httpResponseStatus="Temporary" />
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<remove statusCode="403" subStatusCode="-1" />
<error statusCode="403" prefixLanguageFilePath="" path="/mySite/Error.aspx" responseMode="ExecuteURL" />
<error statusCode="404" prefixLanguageFilePath="" path="/mySite/Error.aspx" responseMode="ExecuteURL" />
</httpErrors>
它可以处理像http://www.mysite/fictiousURL.aspx这样的请求,但无法处理http://www.mysite/fictiousURLTest.html。它似乎只能处理aspx请求。
我还尝试了http://www.15seconds.com/issue/030102.htm,通过在system.web节点中添加此配置
<customErrors mode="On" defaultRedirect="/mysite/error.aspx" />
。有人知道a)为什么IIS7只处理aspx,b)有人知道如何处理通用请求,例如http://www.mysite/fictiousURLTest.html吗?
谢谢,比尔N