Last post Jul 10, 2009 03:55 AM by Keep it Simple
Jul 09, 2009 08:57 PM|Keep it Simple|LINK
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" />
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:
<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
Jul 10, 2009 01:26 AM|kirank28|LINK
look at this
Jul 10, 2009 03:55 AM|Keep it Simple|LINK
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.