thinkphp5 设置404页
2022-07-28 14:14:58
96
{{single.collect_count}}

1.关闭调试模式, 设置部署模式:

// 应用调试模式'app_debug'=> false,// 应用Trace'app_trace'=> false,

2.找到:

// 异常处理handle类 留空使用 \think\exception\Handle'exception_handle' => '',

在其下面添加:

'http_exception_template'=>[// 定义404错误的重定向页面地址404 =>APP_PATH.'404.html',// 还可以定义其它的HTTP status401 =>APP_PATH.'401.html',],

3. 在APP_PATH目录(默认application)下,放置404.html文件即可。

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}