Asp classic 404自定义为空,带有asp扩展名

Asp classic 404自定义为空,带有asp扩展名,asp-classic,iis-7,http-status-code-404,custom-error-pages,Asp Classic,Iis 7,Http Status Code 404,Custom Error Pages,如果我的404自定义设置有asp扩展名,它将显示为空白页。如果我将自定义错误页的扩展名更改为.html,则自定义错误页将正确显示 这是我的web.config文件 <httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL" existingResponse="Auto"> <remove statusCode="404" subStatusCode="-1" />

如果我的404自定义设置有asp扩展名,它将显示为空白页。如果我将自定义错误页的扩展名更改为.html,则自定义错误页将正确显示

这是我的web.config文件

<httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL" existingResponse="Auto">
            <remove statusCode="404" subStatusCode="-1" />                
            <remove statusCode="500" subStatusCode="-1" />
            <error statusCode="500" subStatusCode="100" prefixLanguageFilePath="" path="/error_pages/error500.asp" responseMode="ExecuteURL" />
            <error statusCode="404" subStatusCode="-1" prefixLanguageFilePath=""  path="/error_pages/error404.asp" responseMode="ExecuteURL" />
        </httpErrors>


我想不出来。。。让我发疯

如果您想在错误发生时重定向,请使用

    <httpErrors errorMode="Custom">
        <remove statusCode="404" subStatusCode="-1" />
        <error statusCode="404" prefixLanguageFilePath="" path="/time.asp" responseMode="Redirect" />
    </httpErrors>

您也可以通过使用…隐藏重定向

    <httpErrors errorMode="Custom">
        <remove statusCode="404" subStatusCode="-1" />
        <error statusCode="404" prefixLanguageFilePath="" path="/time.asp" responseMode="ExecuteURL" />
    </httpErrors>

您还可以使用自定义错误(ASP.NET),例如

<system.web>
    <customErrors mode="On">
        <error redirect="time.asp" statusCode="404" />
    </customErrors>
</system.web>


那么,当用户直接在浏览器中请求asp错误页面时,它会工作并返回200状态吗?如果更改直接请求页面的
existingResponse=“Replace”
会发生什么。我改成了“替换”,还是一样。这可能与asp缓存有关吗?我不认为这是缓存问题。尝试在错误asp页面的末尾添加
Response.Flush()
。此外,在IIS中跟踪失败的请求可能会有所帮助。Response.flush也不起作用。。。有趣的是,没有重定向,这似乎是不存在的页面,确实存在,但为空。您解决了这个问题吗?只有当我将自定义404文件重命名为不同于asp的文件时,才有效。这真令人费解!b我的网站运行的是ASP Classic,不是.net。应用程序池正在运行classic。您可以直接浏览到ASP页面吗?另外,您是否尝试获取fiddler跟踪?获取fiddler跟踪并将其发送到rahul@attosol.com如果你愿意的话。在服务器端,应该启用失败的请求跟踪,同时捕获所有内容。最后,检查IIS日志并共享请求。