Did you know: Enable Custom Error (execute a URL) in IIS 7 / 7.5 - Part 2

by Vivek 12/21/2009 9:46:00 PM

Let us have a look at how to enable custom error pages to execute a URL in IIS 7 / 7.5.

In IIS 6.0

  1. Right click on Web Site (Default Web Site in our case) and click on Properties
  2. Under Custom Errors tab, click on the error page you want to customize (in our case 404)
  3. Click Edit…, under Message type: select URL and type the URL /custerr/404.htm

    image14

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 “Execute a URL on this site” and type /custerr/404.htm
  5. Click OK

    image15

Remember, I have a custerr folder in C:\Inetpub\wwwroot folder.

My web.config:

<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/custerr/404.htm" responseMode="ExecuteURL" />
</httpErrors>

Hope this helps,
Vivek Kumbhar

Quote of the day:
J.F.K.--The Man and the Airport - Unknown


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