iis php web.config处理404,500等,跳转友好页面,显示500错误信息

 

显示500错误信息
<pre name="code" class="html"><?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="DetailedLocalOnly" existingResponse="PassThrough"></httpErrors>
<defaultDocument>
<files>
<add value="index.php" />
</files>
</defaultDocument></system.webServer>
</configuration>


404,500友好提示跳转

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>   
    <httpErrors errorMode="DetailedLocalOnly">
<remove statusCode="404"/>
<error statusCode="404" path="/404.htm" responseMode="ExecuteURL"/>
<remove statusCode="500"/>
<error statusCode="500" path="/500.htm" responseMode="ExecuteURL"/>
</httpErrors>
            <defaultDocument>
            <files>
                <add value="index.php" />
            </files>
        </defaultDocument>
</system.webServer>

————————————————
版权声明:本文为CSDN博主「Zmsn丨星辰」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/zmsnxingchen/article/details/42804513

posted @ 2019-09-02 13:33  Nina  阅读(452)  评论(0编辑  收藏  举报