G
Greg Collins [Microsoft MVP]
Okay, this is driving me nuts now. I spent all last night researching newsgroup postings, web articles, etc.
Running multiple sites off the same shared hosting service, I want to be able to redirect a non-existing siteinfo.xml and sitemap.xml to appropriate ASPX pages that will return valid XML for the domain accessed.
I don't understand httpModules and httpHandlers very well but they don't seem to be what I need. There was discussion about using 404 redirects, but I can't seem to get this to work either.
What I currently have set up (which doesn't seem to work) is:
<location path="sitemap.xml">
<system.web>
<customErrors mode="On" defaultRedirect="~/RedirectSiteMap.aspx" />
</system.web>
</location>
or
<location path="sitemap.xml">
<system.web>
<customErrors mode="On" defaultRedirect="~/RedirectSiteMap.aspx">
<error statusCode="404" redirect="~/RedirectSiteMap.aspx" />
</customErrors>
</system.web>
</location>
This fails to work on localhost and on the deployed site. Ideas? What am I missing. I know others have said they have this working?
Running ASP.NET 2.0
Thanks!
Running multiple sites off the same shared hosting service, I want to be able to redirect a non-existing siteinfo.xml and sitemap.xml to appropriate ASPX pages that will return valid XML for the domain accessed.
I don't understand httpModules and httpHandlers very well but they don't seem to be what I need. There was discussion about using 404 redirects, but I can't seem to get this to work either.
What I currently have set up (which doesn't seem to work) is:
<location path="sitemap.xml">
<system.web>
<customErrors mode="On" defaultRedirect="~/RedirectSiteMap.aspx" />
</system.web>
</location>
or
<location path="sitemap.xml">
<system.web>
<customErrors mode="On" defaultRedirect="~/RedirectSiteMap.aspx">
<error statusCode="404" redirect="~/RedirectSiteMap.aspx" />
</customErrors>
</system.web>
</location>
This fails to work on localhost and on the deployed site. Ideas? What am I missing. I know others have said they have this working?
Running ASP.NET 2.0
Thanks!