Forum Moderators: open

Message Too Old, No Replies

IIS custom errors

what is the authoritative perfect way to handle these?

         

httpwebwitch

2:22 am on Nov 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is the definitive way to serve up custom error pages in IIS? Is it using the web.config settings? Or do I use the MMC>Properties>Custom Errors dialog settings? Are there better methods?

How do I ensure that:
1) the client is *not* served a 302 redirection to a 404 page. They should just get a 404 page.
2) it works for all invalid URLs, not just *.aspx pages
3) it plays nicely with ISAPI rewrite

httpwebwitch

9:58 pm on Nov 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



addition / correction:

1) the client should *not* be served a 302 or 301 redirection to a 404 page. They should just get a 404 page with a 404 status header, with my pretty content on it.

2) it must play nicely with ISAPI rewrite

3) it should work with ALL file types, Including *.aspx

4) the 404 page should be ASP-enabled, ie using codebehind, <script runat="server">, or <% %>

httpwebwitch

9:37 pm on Dec 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



bump?

TheNige

8:02 pm on Dec 6, 2005 (gmt 0)

10+ Year Member



Use the custom errors admin in IIS. It will handle all types of errors for any of the the file types.

httpwebwitch

1:33 am on Dec 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



all except *.aspx
those are intercepted by .NET
so I put customerrorhandling in web.config
but that does this awkward 302 redirection thing

is there a good tutorial about setting this up properly?