Custom error page

Discussion in 'ASP.NET 2.0' started by jamesgurung, Jul 6, 2007.

  1. I have always used a custom error page with my site, but today Google Webmaster Tools complained that it was returning 200 OK for all errors. It was right. I have since modified the Page_Load to return appropriate error codes... but this has revealed another problem.

    When I try to reach a .aspx file which does not exist (e.g. www.bodeites.com/fake.aspx) I get a 404 File Not Found as expected. However other non-existent pages (e.g. www.bodeites/com/fake.txt) return 'Unexpected fault' (i.e. my custom error page didn't know what to do). More surprisingly, such files even redirected to the custom error page when I set <customErrors mode='Off'>! What's going on?

    Here's my code:

    web.config
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Do you have .txt mapped to asp.net isapi? If not, it will be handled by IIS.

    Did you set the custom error (in IIS Manager in control panel) to point to your error.aspx page?

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Thanks, I understand now. /emoticons/smile.gif
     
  4. "Do you have .txt mapped to asp.net isapi?"


    How can this be done through the DiscountASP.NET control panel? I do not see a way - only to map custom MIME types.
     
  5. Bruce

    Bruce DiscountASP.NET Staff

Share This Page