2012-04-27 12 views

Trả lời

5

Sử dụng này trong tập tin web.config của bạn:

<httpErrors errorMode="Custom" existingResponse="Replace"> 
    <remove statusCode="404" /> 
    <error statusCode="404" responseMode="ExecuteURL" path="/Errors/NotFound" /> 
</httpErrors> 
12

tôi cũng đã gặp vấn đề tương tự với .htm trang trong IIS7 (không ASP, không NET).

tôi đã thay đổi responseMode-File thay vì ExecuteURL trong <system.webServer> và tất cả mọi thứ làm việc:

<httpErrors errorMode="Custom" existingResponse="Replace"> 
    <remove statusCode="404" /> 
    <error statusCode="404" responseMode="File" path="error.htm" /> 
</httpErrors>