Reputation: 33
My 404 Custom setup shows up as a blank page if it has an asp extension. If I change the extension of the custom error page to .html, the custom error page shows correctly.
this is my web.config file
<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>
I cant figure this out... driving me nuts
Upvotes: 2
Views: 588
Reputation: 4968
If you like to redirect when the error happens, use...
<httpErrors errorMode="Custom">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/time.asp" responseMode="Redirect" />
</httpErrors>
You may also hide the redirection, by using...
<httpErrors errorMode="Custom">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/time.asp" responseMode="ExecuteURL" />
</httpErrors>
You can also use Custom Errors (of ASP.NET) like so...
<system.web>
<customErrors mode="On">
<error redirect="time.asp" statusCode="404" />
</customErrors>
</system.web>
Upvotes: 1