Groups | Blog | Home
all groups > asp.net security > june 2008 >

asp.net security : Exclude Error Status 403 from customErrors Redirect


Larry Neylon
6/10/2008 2:30:56 PM
Hi there,

I've got a site that has custom errors with the web.config looking like
this:
<customErrors mode="RemoteOnly" defaultRedirect="/CustomErrorPage.aspx">

<error statusCode="404" redirect="/404.aspx"/>

</customErrors>


Is there a way of excluding 403 errors from being redirected?

Something to allow me to have this kind of functionality:

<error statusCode="403" ignore="true"/>

Basically I want 403 errors to be reported to bots and crawlers as 403 not
302 redirects which they currently are.

Any suggestions?

Thanks,
Larry.

Alexey Smirnov
6/11/2008 11:00:44 AM
On Jun 10, 3:30=A0pm, "Larry Neylon" <la...@senior.removethis.co.uk>
[quoted text, click to view]

Larry,

I guess you can try to write a custom HttpModule, look at this one

http://www.colincochrane.com/post/2008/01/ASP-NET-Custom-Errors-Preventing-3=
Larry Neylon
6/12/2008 2:32:55 PM
Thanks for that Alexey. Looks workable if there is nothing built into
ASP.Net.

AddThis Social Bookmark Button