IIS7 Custom Error URL Redirects Not Working with non-physical files

10,800

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

Share:
10,800
Pete
Author by

Pete

Updated on June 04, 2022

Comments

  • Pete
    Pete almost 2 years

    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!