Cannot redirect 404 - setting issue?

Discussion in 'ASP .Net' started by Greg Collins [Microsoft MVP], Oct 2, 2006.

  1. ASP.NET 2.0: I am trying to do a redirect for a non-existing file:

    web.config:

    <location path="sitemap.xml">
    <system.web>
    <customErrors mode="On" defaultRedirect="~/RedirectSiteMap.aspx">
    <error statusCode="404" redirect="~/RedirectSiteMap.aspx" />
    </customErrors>
    </system.web>
    </location>


    I cannot get this to work. Others have said they can get it to work. It fails for me both on localhost and on remote server (webhost4life). The site-global version of the customErrors defaultRedirect works just fine... just not any other ones.

    What am I possibly missing that is preventing this from working? Is there some IIS setting I might be missing? Is there something I'm overlooking?

    --
    Greg Collins [Microsoft MVP]
    Visit Brain Trove ( http://www.BrainTrove.com )
    Greg Collins [Microsoft MVP], Oct 2, 2006
    #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. Jonathan Folland
    Replies:
    2
    Views:
    1,615
    Jonathan Folland
    Mar 17, 2005
  2. Pat Carden
    Replies:
    7
    Views:
    6,737
    Juan T. Llibre
    Nov 20, 2005
  3. Replies:
    3
    Views:
    974
    HalcyonWild
    Oct 14, 2005
  4. Replies:
    3
    Views:
    7,769
  5. Sal
    Replies:
    1
    Views:
    381
Loading...

Share This Page