A Web site's error pages are often set to show detailed error information for troubleshooting purposes. However, to prevent unauthorized users from viewing privileged information, you should make sure that detailed error pages will not be seen by remote users.
To prevent IIS7 hijacking your error pages, set existingResponse="PassThrough" in your httpErrors section in your web.config file. For example:
<httpErrors existingResponse="PassThrough" />
To set the custom errors error mode to DetailedLocalOnly or Custom
- Click Start, click Control Panel, and then click Administrative Tools.
- Right-click Internet Information Services (IIS) Manager and select Run as administrator.
- In the Connections pane on the left, expand the computer, then expand the Sites folder.
- Select the Web site or application that you want to configure.
- In Features View, select Error Pages. In the Actions pane, select Open Feature.
- In the Actions pane, select Edit Feature Settings.
- In the Edit Error Pages Settings dialog, under Error Responses, select either Custom error pages or Detailed errors for local requests and custom error pages for remote requests.
- Click OK to exit the Edit Error Pages Settings dialog.