MC9000
MC9000

Reputation: 2423

IIS 7 "Send errors to browser" set to FALSE, but detailed errors still being shown in browser (Classic ASP)

I found a bug in IIS7 and am looking for a workaround. After turning off client side and server side debugging for clients that still have their Classic ASP sites on my server, I discovered to my horror, that IIS 7 is STILL sending fully detailed messages to the client!

I've specified custom error pages as well (all of which redirect to a generic error page except 404 errors - those just get displayed in full, including the internal path of the websites in question). I can't seem to find a work around or patch or anything.

I did a hack that generates "The page cannot be displayed because an internal server error has occurred." instead of displaying the 404 error by putting the following into the web.config file of the Classic ASP site in question:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <remove value="index.html" />
                <remove value="index.php" />
                <remove value="default.aspx" />
                <remove value="iisstart.htm" />
                <remove value="index.htm" />
                <remove value="Default.htm" />
                <add value="index.asp" />
            </files>
        </defaultDocument>
        <httpErrors errorMode="DetailedLocalOnly" defaultResponseMode="File" >
            <remove statusCode="404" />
            <error statusCode="404" path="~\error404.htm" />
        </httpErrors>
    </system.webServer>
</configuration>

Unfortunately, the httpErrors tag doesn't seem to work properly for classic ASP sites, no matter what you put in the path variable, an internal server error will occur. The point is to remove the status code here as there is no way to do this globally in IIS 7 (at least that I can find). The good news is that there is no detailed 404 error, the bad news is that trapping 404 errors is not possible (for ASP).

Any better (working) ideas?

Upvotes: 0

Views: 1919

Answers (1)

MarceloBarbosa
MarceloBarbosa

Reputation: 915

On IIS, go to your Website, go to ASP and change the Debugging Properties like following:

enter image description here

Change all to "False" and done.

Upvotes: 0

Related Questions