IIS Error Pages Instruction

Discussion in 'Site Programming, Development and Design' started by Ray, Dec 16, 2010.

  1. Ray

    Ray

    Updated Version: These steps work for IIS 7 and IIS 8.

    This IIS 7 Module allows you to set your custom error page.
    To set your custom error page follow these steps.

    1. Connect to the web server using IIS 7 Manager.
    2. Go to the module Error Pages.
    3. Right click on the targeted status code.
    4. Click on Edit.
    5. Click on Execute a URL on this site: input the relative page to the custom error Page.
    a. Example: /ErrorPages/404.html​
    6. Click OK.
    7. Click on Edit Feature Settings.
    8. Custom error Pages.

    Just like any IIS 7 Module you can either go through IIS 7 Manager to configure the settings or directly code it in the applications web.config file. Here is an example on how to set the custom Error Page in the applications web.config file.

    Code:
    <configuration>
        <system.webServer>
            <httpErrors errorMode="Custom">
                <remove statusCode="404" subStatusCode="-1" />
                <error statusCode="404" prefixLanguageFilePath="" path="/errorPages/404.html" responseMode="ExecuteURL" />
            </httpErrors>
        </system.webServer>
    </configuration>
     

Share This Page