当前位置首页 > IIS知识

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

阅读次数:375 次  来源:admin  发布时间:

显示500错误信息

lt;pre name="code" class="html"><?xml version="1.0" encoding="UTF-8"?>

lt;configuration>

lt;system.webServer>

lt;httpErrors errorMode="DetailedLocalOnly" existingResponse="PassThrough"></httpErrors>

lt;defaultDocument>

lt;files>

lt;add value="index.php" />

lt;/files>

lt;/defaultDocument></system.webServer>

lt;/configuration>

404,500友好提示跳转

lt;?xml version="1.0" encoding="UTF-8"?>

lt;configuration>

lt;system.webServer>

lt;httpErrors errorMode="DetailedLocalOnly">

lt;remove statusCode="404"/>

lt;error statusCode="404" path="/404.htm" responseMode="ExecuteURL"/>

lt;remove statusCode="500"/>

lt;error statusCode="500" path="/500.htm" responseMode="ExecuteURL"/>

lt;/httpErrors>

lt;defaultDocument>

lt;files>

lt;add value="index.php" />

lt;/files>

lt;/defaultDocument>

lt;/system.webServer>

————————————————

版权声明:本文为CSDN博主「Zmsn丨星辰」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/zmsnxingchen/article/details/42804513

上一篇:IIS开启GZIP压缩的部署方法
下一篇:Linux学习4-阿里云服务器(CentOS)下使用Tomcat安装Jenkins