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
- Right click on Web Site (Default Web Site in our case) and click on Properties
- Under Custom Errors tab, click on the error page you want to customize (in our case 404)
- Click Edit…, under Message type: select URL and type the URL /custerr/404.htm
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 “Execute a URL on this site” and type /custerr/404.htm
- Click OK
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