I am trying to redirect my web application to a custom 404 page. It works for all URLs except when they have the extension “.aspx”
The server is Windows Server 2008, and the following parameters I have in my web.config (for example, using google.com):
<customErrors defaultRedirect="http://www.google.com" mode="On" redirectMode="ResponseRedirect"></customErrors> <httpErrors errorMode="Custom"> <clear /> <remove statusCode="500" subStatusCode="-1" /> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" prefixLanguageFilePath="" path="/404-Page/" responseMode="ExecuteURL" /> <error statusCode="500" prefixLanguageFilePath="" path="/404-Page/" responseMode="ExecuteURL" /> </httpErrors>
Again, HTTP errors work for everything except the ".aspx" extensions
source share