我有一个全新安装的Windows Server 2008与IIS7。我安装了“Classic ASP”,并将调试选项“将错误发送到浏览器”更改为True。经典ASP - 自定义错误页面
我创建一个目录,2个文件:
-- C:\inetpub\wwwroot\stadtbibliothek
- index.asp -> <% Response.Write "Hello World" %>
- 500-100.asp -> <% Response.Write "Error" %>
我konverted目录中的应用程序并为其分配一个应用程序池,我创建(.NET版本:无托管代码, pipelinecode:classic)。
然后我测试了远程客户端的页面(http://svr-name.domain/stadtbibliothek/)和“Hello World”出现。
2.
我添加一个错误给的index.asp文件和一个web.config文件以 “stadtbibliothek” 文件夹(有没有在根):
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value="index.asp" />
</files>
</defaultDocument>
<httpErrors>
<remove statusCode="500" subStatusCode="100" />
<error statusCode="500" subStatusCode="100" prefixLanguageFilePath="" path="/error.asp" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
</configuration>
解决方案:
原来我只是需要包括文件夹名,路径:
<error statusCode="500" subStatusCode="100" prefixLanguageFilePath="" path="/stadtbibliothek/error.asp" responseMode="ExecuteURL" />
感谢您的建议!