Iis 7 经典ASP-自定义错误页
我有一个干净的安装Windows Server 2008与IIS7。我在那里安装了“Classic ASP”,并将调试选项“将错误发送到浏览器”更改为True 1. 我创建了一个包含2个文件的目录:Iis 7 经典ASP-自定义错误页,iis-7,asp-classic,custom-error-pages,Iis 7,Asp Classic,Custom Error Pages,我有一个干净的安装Windows Server 2008与IIS7。我在那里安装了“Classic ASP”,并将调试选项“将错误发送到浏览器”更改为True 1. 我创建了一个包含2个文件的目录: -- C:\inetpub\wwwroot\stadtbibliothek - index.asp -> <% Response.Write "Hello World" %> - 500-100.asp -> <% Response.Write "Error" %&
-- C:\inetpub\wwwroot\stadtbibliothek
- index.asp -> <% Response.Write "Hello World" %>
- 500-100.asp -> <% Response.Write "Error" %>
--C:\inetpub\wwwroot\stattbibliothek
-index.asp->
-500-100.asp->
我将目录转换为一个应用程序,并分配了一个我创建的应用程序池(.net版本:无托管代码,pipelinecode:classic)
然后,我从一个远程客户端()测试了该页面,并显示了“Hello World”
2.
我在index.asp文件中添加了一个错误,在“StattBiblioThek”文件夹中添加了一个web.config文件(根目录中没有):
解决方案:
结果我只需要在路径中包含文件夹名称:
谢谢你的建议我认为您应该注意以下错误:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
*
*
*
</system.webServer>
<system.web>
<customErrors mode="On"/>
</system.web>
</configuration>
*
*
*
来自:
路径:必需的字符串属性
指定响应HTTP的文件路径或URL
statusCode和subStatusCode属性指定的错误。如果你
选择文件响应模式,指定自定义文件的路径
错误页。如果选择ExecuteURL响应模式,则该路径具有
作为服务器相对URL(例如,/404.htm)。如果你选择
重定向响应模式,您必须输入一个绝对URL(用于
例如,www.contoso.com/404.htm)
尝试更改此行:
<error statusCode="500" subStatusCode="100" prefixLanguageFilePath="" path="/error.asp" responseMode="ExecuteURL" />
为此:
<error statusCode="500" subStatusCode="100" prefixLanguageFilePath="" path="/stadtbibliothek/error.asp" responseMode="ExecuteURL" />
<error statusCode="500" subStatusCode="100" prefixLanguageFilePath="" path="/stadtbibliothek/error.asp" responseMode="ExecuteURL" />