Reputation: 1808
I have tried many ways but unable to do this. I have set the web.config as below.
<?xml version="1.0"?>
<configuration>
<system.webServer>
<asp scriptErrorSentToBrowser="true"/>
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/index.asp" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
<system.web>
<customErrors mode="On" defaultRedirect="index.asp">
</customErrors>
<compilation debug="false"/>
</system.web>
</configuration>
When I try this url
http://www.aboutmanchester.co.uk/wddwd.asp
It show a message not the error page I mention but when I try
http://www.aboutmanchester.co.uk/wddwd.aspx
I goes to the custom error page.
Upvotes: 1
Views: 1018
Reputation: 1462
Is that an exact web.config copy? Without the errorMode="Custom" attribute on the httpErrors element I only get 404 pages to work with .aspx pages and get a generic IIS error page if I hit a issing .asp page. Adding the attribute gives me the expected behaviour.
<httpErrors errorMode="Custom">
Upvotes: 1
Reputation: 18477
Is the application pool set to 'classic'?
http://technet.microsoft.com/en-us/library/cc753449%28WS.10%29.aspx
Upvotes: 1