Custom Error Pages and URLRewriter.net

Last post 07-10-2009 3:55 AM by Keep it Simple. 2 replies.

Sort Posts:

  • Custom Error Pages and URLRewriter.net

    07-09-2009, 8:57 PM
    • Member
      261 point Member
    • Keep it Simple
    • Member since 08-04-2005, 6:29 AM
    • Australia
    • Posts 99

    I'm using URLRewriter.net to get friendly URL's and have setup my web.config custom error section as follows:

    <customErrors mode="On" defaultRedirect="~/error.htm">
                <error statusCode="400" redirect="~/400.aspx" />
                <error statusCode="401" redirect="~/401.aspx" />
                <error statusCode="403" redirect="~/403.aspx" />
                <error statusCode="404" redirect="~/404.aspx" />
                <error statusCode="500" redirect="~/500.aspx" />          
    </customErrors>

    However, it seems the URLRewriter.net kicks in and ignores the ASP.NET custom error section in some scenarios and just displays the infamous and ugly error message.

    My search efforts found: http://urlrewriter.net/index.php/support/reference/error-handler/error-page

    <error-handler code="500" url="/oops.aspx" />
    <error-handler code="404" url="/not-found.html" />

    Perhaps a silly question but where exactly in the web.config file do you place the <error-handler> code? (I have tried several places without any luck). Thanks

  • Re: Custom Error Pages and URLRewriter.net

    07-10-2009, 1:26 AM
    • Member
      339 point Member
    • kirank28
    • Member since 05-18-2009, 6:49 AM
    • Posts 165
    Thank You,
    Kiran K.

    Remember to click “Mark as Answer” on the post,if it helps you.

    Coding Stuffs | Web Development help

    Mozilla Labs Projects
  • Re: Custom Error Pages and URLRewriter.net

    07-10-2009, 3:55 AM
    • Member
      261 point Member
    • Keep it Simple
    • Member since 08-04-2005, 6:29 AM
    • Australia
    • Posts 99

    Kiran, thanks for the prompt reply.

    The suggested solution is to use the ASP.NET CustomErrors, which is exactly what I am doing (as mentioned in my post submission) - yet it does not work all the time. Clearly, the presence of URLRewriter.Net intercepts the workflow in certain situations which bypasses the traditional ASP.NET custom error processing model.

    Moreover, the response in the recommedned link above, asks my very question and it appears to remain unanswered.

    Any ideas? Thanks

    PS. I had already tried placing the URLRewriter.Net <error-handler ... code in the <rewriter> section amonst other sections.

Page 1 of 1 (3 items)