This article introduces how to use ThinkPHP to implement a 404 page. I hope it will be helpful to friends who are learning thinkphp!
How to create a 404 redirect page in Thinkphp
There are many thinkphp 404 page creation methods on the Internet, but most of them are too cumbersome. It's simple, but it's annoying, so I'm sharing with you the most convenient way to make 404, 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
This is done, as for the status code Of course it's 404, because thinkphp returns 404 by default for pages that don't exist, and you're done!
(Recommended tutorial:thinkphp tutorial)
The above is the detailed content of How to create a 404 jump page in Thinkphp. For more information, please follow other related articles on the PHP Chinese website!