IIS7 Overrides customErrors when setting Response.StatusCode?

Set existingResponse to PassThrough in system.webServer/httpErrors section:

  <system.webServer>
    <httpErrors existingResponse="PassThrough" />
  </system.webServer>

Default value of existingResponse property is Auto:

Auto tells custom error module to do the right thing. Actual error text seen by clients will be affected depending on value of fTrySkipCustomErrors returned in IHttpResponse::GetStatus call. When fTrySkipCustomErrors is set to true, custom error module will let the response pass through but if it is set to false, custom errors module replaces text with its own text.

More information: What to expect from IIS7 custom error module

Leave a Comment