There are times when you need to use your own custom error messages not the default IIS ones. In my case, I wanted to use it for redirection, assume that you want to tell IIS that if it gets a request like http://i-bander.com/, http://i-bander.com/subsite/, or http://i-bander.com/subsite/subsite/somepage.aspx to redirect to http://i-bander.com/newsubsite. At first when I thought of it, I was hmm, we can defiantly use the Refresh meta tag. But it would only work on http://i-bander.com/ and each virtual directory you set the redirection HTML file in. I know it’s not efficient and dah! Super static! I won’t keep on yada yada, SharePoint itself does not have the sites as virtual directories, and instead they are all virtually stored in SQL Server.
My best bet at the time was utilizing "HTTP 404 – File not found", "HTTP 403 – Forbidden", and "HTTP 401 – Unauthorized" IIS error messages.
Edit the HTTP Error, and place the fully qualified path of your error message HTML file, or in my case the HTML file with the Refresh Meta tag. Don’t start being a smart ass and say, I can use URLs instead, it’s true, BUT some errors won’t be able to use URLs so you don’t want to get stuck in having multiple routs, ones with a HTML file and others with URLs.
The best practice is using a single redirection file for the custom error messages. Below is a screen shot for 2 404 custom messages:
Now you might think your job is done, don’t be happy yet, IE 7 comes with an option called "Show friendly HTTP error messages" which gives IE the privilege of rendering its own friendly error message instead of your custom IIS message. This can be disabled by un-checking the option check box in the Advanced tab of Internet Options under IE Tools menu. However in large environments, such as where I work, Service Desk guys will shoot me if I log a call for somebody to do this manually. Thank god this can be done by updating the domain policy and enforcing it on logon.