custom server errors and wen.config

Discussion in 'ASP .Net' started by Adie, Jan 27, 2004.

  1. Adie

    Adie Guest

    Hi, I have custom errors set in the web.config and am wanting to
    redirect any bad url requests; 404 etc back to index.aspx

    In web.config i have:
    <customErrors mode="On" defaultRedirect="error404.aspx" />

    which redirects to error404.aspx, then in error404.aspx I have:
    <meta http-equiv="refresh" content="3;url=index.aspx"> which seems to
    work fine if i mess with the url file name but not the file extension,
    so if I typle "indx.aspx" the server will redirect back to index.aspx
    but a request for "index.asp" causes a plain old 404 error.

    Any ideas why this must be?
     
    Adie, Jan 27, 2004
    #1
    1. Advertising

  2. Adie

    Jon Davis Guest

    Web.config is ASP.NET-only and is not handled when referencing a nonexistent
    file or an ASP Classic or HTML file.

    Jon


    "Adie" <> wrote in message
    news:...
    > Hi, I have custom errors set in the web.config and am wanting to
    > redirect any bad url requests; 404 etc back to index.aspx
    >
    > In web.config i have:
    > <customErrors mode="On" defaultRedirect="error404.aspx" />
    >
    > which redirects to error404.aspx, then in error404.aspx I have:
    > <meta http-equiv="refresh" content="3;url=index.aspx"> which seems to
    > work fine if i mess with the url file name but not the file extension,
    > so if I typle "indx.aspx" the server will redirect back to index.aspx
    > but a request for "index.asp" causes a plain old 404 error.
    >
    > Any ideas why this must be?
     
    Jon Davis, Jan 27, 2004
    #2
    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. Replies:
    2
    Views:
    756
    Bruce Barker
    Dec 2, 2005
  2. greg
    Replies:
    4
    Views:
    486
    David Segall
    Jan 20, 2006
  3. CSharpner
    Replies:
    0
    Views:
    1,050
    CSharpner
    Apr 9, 2007
  4. Lubomir
    Replies:
    1
    Views:
    505
    bruce barker
    Jul 2, 2008
  5. Stefan Soljemo
    Replies:
    3
    Views:
    747
    Alexey Smirnov
    Nov 4, 2009
Loading...

Share This Page