Home>Article>PHP Framework> How to quickly implement 404 jump page in Thinkphp

How to quickly implement 404 jump page in Thinkphp

藏色散人
藏色散人 forward
2022-01-11 16:06:38 2864browse

The followingthinkphp frameworktutorial column will introduce to you how to create a 404 jump page in Thinkphp. I hope it will be helpful to friends in need!

Thinkphp makes 404 jump page

There are many thinkphp 404 page making methods on the Internet, but most of them are too cumbersome, inconvenient, and annoying, so I share them with you. The most convenient way to make 404 is as follows.

Add configuration items to the config configuration file in the public directory of thinkphp:

'TMPL_EXCEPTION_FILE' => 'Public/404.html',

Create 404.html in the Public folder with the following content

    404哟   

404

该页面不存在(′?ω?`)5秒后跳转到首页

This is done. As for the status code, of course it is 404, because thinkphp returns 404 by default for pages that do not exist, and you’re done!

Recommended learning: "The latest 10 thinkphp video tutorials"

The above is the detailed content of How to quickly implement 404 jump page in Thinkphp. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:juejin.im. If there is any infringement, please contact admin@php.cn delete