All,
I'm trying to get custom error pages working for my asp.net 2.0 site. I thought I'd start out with a simple 404 error handler. It's been frustrating, to say the least. I first tried using the "built in", asp.net solution via web.config:
<customErrors mode="On" defaultRedirect="~/errors/ServerError.aspx">
<error statusCode="404" redirect="~/errors/NotFound.aspx"/>
</customErrors>
Problem with that is that it only works when the requested page is an aspx extension. Other pages are sent to the default IIS 404 page. So I set up a custom error page in Control Center (which just fronts for IIS's custom error page configuration).
Okay, now both aspx page requests and non-aspx page requests are caught and redirected to my NotFound.aspx page. The next problem is that the server responses are not what I want. In this setup, by default, the server responses when using both IIS redirects and asp.net, web.config redirects, wind up being:
requested page was aspx: 302 found
requested page not aspx: 200 ok
What I really want is to always send a 404 (not found) response except for a few pages where I want to do a 301 (permanent redirect) to a page that has replaced the requested page. For non aspx pages (those that were redirected to my error page by IIS), I can easily change the response headers to respond as desired. But for aspx pages (those redirected to my error page via asp.net), my manipulation of the response headers fails; it always returns 200 ok.
Aaaaaaaaaaaaaaaaahhhhhhhhhh! 
So I tried switching the customErrors section to "Off" altogether and just using the IIS error page redirect. No good. Non-aspx pages still work (via IIS), but when an aspx page is requested, the user is sent to a page with: "server error in '/' application - resource not found" and some other crap.
I guess at this point, the easiest question is, how can I get the Control Center error page setup to work for both aspx and non-aspx page requests? The more complicated question to ask is, how is everyone else handling this?
Thanks,
Andy