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?
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?