There was no option in IIS 6.0 to redirect a client browser to a different URL that contains the custom error. Here’s how you do it in IIS 7 / 7.5.
- Click on the Web Site (Default Web Site in our case)
- In Features View, double click on Error Pages
- Select the error page we want to customize (in our case 404)
- Click Edit..., click “Respond with a 302 redirect” and type the complete URL (e.g.: http://www.dotnetscraps.com/custerr/404.htm)
- Click OK
My web.config:
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path=http://www.dotnetscraps.com/custerr/404.htm
responseMode="Redirect" />
</httpErrors>
Hope this helps,
Vivek Kumbhar
Quote of the day:
I'm seventeen and I'm crazy. My uncle says the two always go together. When people ask your age, he said, always say seventeen and insane. - Ray Bradbury