Turn IIS7 HTTP Error Handling Off?

前端 未结 2 1004
醉梦人生
醉梦人生 2020-12-04 18:14

I just got setup on my first Windows Server 2008 / IIS7.5 server for a contest I am participating in. I can\'t for the life of me figure out how to turn OFF error ha

相关标签:
2条回答
  • 2020-12-04 18:26

    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\inetsrv
    
    appcmd unlock config /section:httpErrors
    
    0 讨论(0)
  • 2020-12-04 18:32

    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.

    0 讨论(0)
提交回复
热议问题