Did you know: Enable Custom Error (redirect) in IIS 7 / 7.5 - Part 3

by Vivek 12/22/2009 9:36:00 PM

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.

  1. Click on the Web Site (Default Web Site in our case)
  2. In Features View, double click on Error Pages
  3. Select the error page we want to customize (in our case 404)
  4. Click Edit..., click “Respond with a 302 redirect” and type the complete URL (e.g.: http://www.dotnetscraps.com/custerr/404.htm)
  5. Click OK

    image16

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


blog comments powered by Disqus

Rahul Soni

Rahul Soni  Twitter

 LinkedIn

 Facebook

 Email me



Vivek Kumbhar

Vivek Kumbhar  Twitter

 LinkedIn

 Facebook

 Email me


Stack Exchange

profile for Vivek at Server Fault, Q&A for system administrators and IT professionals

profile for Rahul Soni at Stack Overflow, Q&A for professional and enthusiast programmers

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

All Items
Sign in

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2012, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0