Enable custom error pages on IIS 7 (Windows 2008) and newer Print

  • 0

Custom error pages can be implemented in IIS 7 (Windows 2008) and newer by placing a web.config override file in the document root of your web site.  Below is example content for custom 403 and 404 status pages:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpErrors>
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" prefixLanguageFilePath="" path="/custom404.htm" responseMode="ExecuteURL" />
            <remove statusCode="403" subStatusCode="-1" />
            <error statusCode="403" prefixLanguageFilePath="" path="/custom403.htm" responseMode="ExecuteURL" />
        </httpErrors>
    </system.webServer>
</configuration>

 


Was this answer helpful?

« Back