customErrors question

  • Thread starter Thread starter Popman
  • Start date Start date
P

Popman

Hi there,

I put the following to the web.config file to handle the "File not found"
exception:

<customErrors defaultRedirect="http://www.mydomain.com/"
mode="RemoteOnly" >
<error statusCode="404" redirect="http://www.mydomian.com/" />
</customErrors>



It works fine when I try to visit non-existed .aspx page, but does not work
for other types of pages, such as .htm, html, .zip, etc.

Is it because those pages are handled by IIS instead of asp.net process?
If I do want to implement this only in asp.net(I have no access to IIS), how
can I do it?


Thanks.


Neo
 
Is it because those pages are handled by IIS instead of asp.net process?

Yes, it is. Only files mapped to the aspnet_isapi.dll extension in IIS
generate these errors. Files not served through the aspnet_isapi.dll
are not processed by ASP.NET and generate IIS errors.
 
Back
Top