Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

ExistingResponse="PassThrough" breaks IIS Custom Errors in IIS 7.5 (Windows 2008 R2).

$
0
0

We use a mixture of Classic ASP and C# on the same servers.

We use custom errors (setup under IIS Admin / IIS / Error Pages) for 404 and 500, to redirect to /errors/404.asp and /errors/500.100.asp.

Everything worked great on IIS6 and on IIS7.5 once we got all the rest of the settings working.

We have a bunch of pages -- both classic asp and dotnet -- which manually set Response.Status to something other than 200 -- in addition to printing out some text. This works fine in IIS 6.

However in IIS 7.5, when we set Response.Status from either Classic ASP or DotNet to 500, something in IIS decides to take over, and refuses to output my text. Instead, it prints the useless text:

The page cannot be displayed because an internal server error has occurred.

Various links (http://forums.iis.net/t/1149030.aspx, http://stackoverflow.com/questions/434272/iis7-overrides-customerrors-when-setting-response-statuscode, http://forums.iis.net/p/1157764/1904516.aspx) suggest setting:

<httpErrors errorMode="Custom" existingResponse="PassThrough"/>

This allows the page to print the text that we sent to the Response.  However, it breaks custom errors. So now http://localhost/NotHere.gif, http://localhost/aspNotHere.asp and no longer uses the custom /errors/404.asp page.

How do we make IIS7.5 act like IIS6 -- so that custom errors actually work, and IIS lets me set whatever Http status I want, combined with whatever text that I want?

Thanks,

Andrew Csontos

 


Viewing all articles
Browse latest Browse all 780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>