Exclude Error Status 403 from customErrors Redirect

L

Larry Neylon

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.
 
G

Guest

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.

Larry,

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

http://www.colincochrane.com/post/2...ting-302-Redirects-To-Custom-Error-Pages.aspx
 
L

Larry Neylon

Thanks for that Alexey. Looks workable if there is nothing built into
ASP.Net.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top