Custom error pages for HTTP errors with IIS status codes

Discussion in 'ASP .Net' started by =?Utf-8?B?RGFuaWVsIEtvcHA=?=, Jul 12, 2005.

  1. Hi!

    I tried to implement custom error pages using the <customErrors> directive
    in a web.config file. It worked fine for "simple" errors like HTTP 404, like
    this example:

    <customErrors mode="On">
    <error statusCode="404"
    redirect="http://localhost/ErrorPages/Error404.aspx"/>
    </customErrors>

    My problem is: I wanted to do that for errors like HTTP 401 (Unauthorized)
    as well. But those errors come with additional IIS status codes, e.g. HTTP
    401.2 (Unauthorized: Access is denied due to server configuration). So, how
    can I target such an error with the aforementioned customErrors directive? I
    already tried to enter values like "401.2", "401;2", "401-2", but the
    statusCode attribute only accepts integer values. "4012", or just "401" (one
    page for all IIS status codes) didn't work as well.

    I would really like to use this method, and no "workarounds" like using the
    Application_Error event in global.asax.

    --
    Daniel Kopp
    MCP

    HUENGSBERG AG
    Lilienthalstr. 29
    D-85399 Hallbergmoos
     
    =?Utf-8?B?RGFuaWVsIEtvcHA=?=, Jul 12, 2005
    #1
    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. Andy Fish

    constants for http status codes

    Andy Fish, Mar 3, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    3,871
    Juan T. Llibre
    Mar 4, 2005
  2. Alvin A. Delagon

    urllib http status codes

    Alvin A. Delagon, Dec 29, 2005, in forum: Python
    Replies:
    1
    Views:
    454
    Kent Johnson
    Dec 29, 2005
  3. Replies:
    2
    Views:
    2,981
    Malcolm
    Aug 20, 2005
  4. Raterus

    WebClient + Credentials + HTTP 401 Status Codes

    Raterus, Feb 9, 2005, in forum: ASP .Net Security
    Replies:
    5
    Views:
    386
    Joe Kaplan \(MVP - ADSI\)
    Feb 10, 2005
  5. Oxnard

    http status codes and javascript

    Oxnard, Oct 23, 2004, in forum: Javascript
    Replies:
    3
    Views:
    204
    Martin Honnen
    Oct 24, 2004
Loading...

Share This Page