Redirects not working in IIS with ASP.Net

Posted by Blake on 11/26/2012
)

You may notice that even though you have correctly setup your custom error pages in the web.config that under some circumstances, they still don’t work. We’ve recently been using IIS6 with ASP.NET 4 and have had a number of issues come up with this combinations (a lot of which revolve around redirect issues). In our case, one of our sysadmin manually setup the custom error pages in IIS for the site in question.

After, we noticed that the 404 pages worked in IE, but not in Chrome or FireFox (urg). The fix for this that we found was when setting the custom file in IIS, it needed to be setup as a URL and not as a FILE. Doing this changed the content type that IIS was sending with the file (it went from an application/octet-stream to a text/html). After changing this, IE, Chrome and FireFox all correctly displayed our custom error pages.

We were put onto the right track from a forum thread found here: http://forums.mozillazine.org/viewtopic.php?f=38&t=1890585