thinkphp5 模块,控制器,方法不存在跳转404
2022-07-28 14:14:58
317
{{single.collect_count}}

1、application/config.php 文件里面添加:

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

2、application/config.php 文件中的app_debug 设置为false 如下:

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

3、404页面 放在 application 目录下

回帖
全部回帖({{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 ? '加载中...' : '查看更多评论'}}