views:

2912

answers:

2

So here's the issue. We run Sitecore, which does URL rewriting, and allows for something like example.com/Folder/Page.aspx to be a proper URL.

Now, "Folder" doesn't actually exist on the file system, and neither does "Page.aspx". But those URL's work, because ASP.NET does what it's supposed to.

Okay, so now say I try to go to a web page that doesn't exist like example.com/idontexist.html. This doesn't exist in on the file system, and doesn't use ASP.NET to resolve the file, so then we get a IIS7 404 Error.

Now, I want to change the 404 Error Page to a Custom Error Page, by using a URL. Say, the URL is example.com/ErrorPage.aspx. This page is actually, not a physical page, but an item in Sitecore.

In the Custom Error configuration in IIS Manager, I am trying to change the 404 Error to point to a "URL Redirect" and I'm using "/ErrorPage.aspx" as the URL redirect. When I try to then go to a URL that doesn't exist, IIS7 blows up with an error saying that it can't find /ErrorPage.aspx.

In IIS6, this isn't an issue, and everything works fine. But on IIS7, I redirect to a URL that isn't physically on the server.

Help!

A: 

to make a very long story short, here's the thing:

1) configure IIS so that 404 errors go to "default.aspx" 2) create a page that actually handles what you want to handle.

Reference links, SDN originals:

http://sdn5.sitecore.net/upload/sitecore6/handling_http_404_a4.pdf http://sdn.sitecore.net/upload/sitecore6/dynamic_links_a4.pdf

Mark Cassidy
Alright, the Handling http 404 PDF was a real help. I added the processor into the pipeline, and that seemed to do the trick. The problem I'm now facing is that in IIS, for non-asp.net items like http://www.example.com/text.txt, if that text file isn't there, I tried to map the Custom Error to Execute URL /Default.aspx, but that gave me an error. Seems like any *.aspx extension that I add in the Custom Error's feature in IIS, returns a generic 404 error.
Pete
Yes, IIS would normally not get involved in non-ASP known extensions. You can either A) map them, so that .HTML, .TXT and so on go to .NET handlers just like .aspx and .asmx and so on - or B) Enable integrated pipeline (IIS7 only) which would involve ASP.NET in all page requests. Both options come with a few caveats however.
Mark Cassidy