Exclude Error Status 403 from customErrors Redirect

Discussion in 'ASP .Net Security' started by Larry Neylon, Jun 10, 2008.

  1. Larry Neylon

    Larry Neylon 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 Neylon, Jun 10, 2008
    #1
    1. Advertising

  2. On Jun 10, 3:30 pm, "Larry Neylon" <>
    wrote:
    > 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
     
    Alexey Smirnov, Jun 11, 2008
    #2
    1. Advertising

  3. Larry Neylon

    Larry Neylon Guest

    Thanks for that Alexey. Looks workable if there is nothing built into
    ASP.Net.
     
    Larry Neylon, Jun 12, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?R3JlZyBIdXJsbWFu?=

    Redirect to IIS 401/403 error page in HttpModule?

    =?Utf-8?B?R3JlZyBIdXJsbWFu?=, Oct 28, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,049
    Ben Strackany
    Oct 28, 2004
  2. John Clark

    customErrors redirect error analysis

    John Clark, Jun 22, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    370
    John Clark
    Jun 22, 2005
  3. cmay
    Replies:
    3
    Views:
    262
  4. willem joubert

    Error 403-Error 403-Error 403

    willem joubert, Feb 8, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    204
    Bruce Johnson [C# MVP]
    Feb 8, 2005
  5. Amit
    Replies:
    5
    Views:
    292
Loading...

Share This Page