我想用户'error.html‘的任何错误IIS可能遇到。
如果我在webconfig中声明以下块,则站点拒绝运行。
<httpErrors errorMode="DetailedLocalOnly" existingResponse="Replace" defaultPath="/error.html" defaultResponseMode="ExecuteURL">
<remove statusCode="500" subStatusCode="-1" />
<remove statusCode="404" subStatusCode="-1" />
<remove statusCode="403" subStatusCode="-1" />
<remove statusCode="401" subStatusCode="-1" />
<error statusCode="401" prefixLanguageFilePath="" path="/401.html" responseMode="ExecuteURL" />
<error statusCode="403" prefixLanguageFilePath="" path="/403.html" responseMode="ExecuteURL" />
<error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" />
<error statusCode="500" prefixLanguageFilePath="" path="/500.html" responseMode="ExecuteURL" />
</httpErrors>
注意根元素中的属性defaultPath="/error.html“。
我得到了以下错误
HTTP-Fehler 500.19 -内部服务器错误
..。
Konfigurationsfehler: Sperrverletzung
..。
发布于 2009-08-13 12:54:07
编辑%windir%\system32\inetsrv\config\applicationHost.config
设置线路:
<httpErrors lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
至:
<httpErrors lockAttributes="allowAbsolutePathsWhenDelegated">
发布于 2009-08-27 15:05:56
尝试使用IIS 7管理器正确设置此设置。另外,你也可以这样做:
<system.web>
<customErrors mode="On" defaultRedirect="~/error.html">
</customErrors>
</system.web>
发布于 2017-01-04 08:39:52
除了Fabian的回答之外,您还可以在以下文件中找到该文件:
https://serverfault.com/questions/53712
复制相似问题