您的位置:首页 > 编程语言 > PHP开发

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

2015-01-17 12:36 645 查看
显示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>
</configuration>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息