Cannot redirect 404 - setting issue?

  • Thread starter Greg Collins [Microsoft MVP]
  • Start date
G

Greg Collins [Microsoft MVP]

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?
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top