Turn IIS7 HTTP Error Handling Off? Turn IIS7 HTTP Error Handling Off? windows windows

Turn IIS7 HTTP Error Handling Off?


After some more extensive searching, I found the answer here:

http://blogs.msdn.com/webdevelopertips/archive/2009/08/24/tip-93-did-you-know-php-and-custom-error-pages-configuration.aspx

The solution is to manually edit your web.config file with this custom "httpErrors" entry:

<?xml version="1.0" encoding="UTF-8"?><configuration>    <system.webServer>        <httpErrors existingResponse="PassThrough" />    </system.webServer></configuration>

However, due to IIS 7.0 "lockdown" feature you might get a "This configuration section cannot be used at this path. This happens when the section is locked at a parent level." error. To solve that, execute the following in the command prompt:

cd C:\Windows\System32\inetsrvappcmd unlock config /section:httpErrors


In IIS Manager -> Site -> Error Pages, right-click each error page and choose ‘Remove’.

Unfortunately there is not a way to tell IIS not to interfere from the script side, so it's always an annoying deployment issue.