The IIS7 custom error pages are handled in the <system.webServer>
configuration section not the <customErrors>
section under <system.web>
which applies to ASP.NET only:
<configuration>
<system.webServer>
<httpErrors>
<error
statusCode="500"
subStatusCode="100"
path="/500errors.asp"
responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
</configuration>
Beware though of these settings conflicting with ASP.NET custom errors. If you're running .NET 3.5 and above you can set Response.TrySkipIisCustomErrors
in your ASP.NET error page code-behind (or error controller if using MVC) to prevent IIS overriding your ASP.NET error page(s):
Response.TrySkipIisCustomErrors = true // ASP.NET Forms
This article by Rick Strahl explains this problem in a bit more depth:
IIS 7 Error Pages taking over 500 Errors