Home> PHP Framework> ThinkPHP> body text

How to create a 404 jump page in Thinkphp

angryTom
Release: 2020-03-27 13:32:55
forward
3345 people have browsed it

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 jump page in 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',
Copy after login

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

    404哟   

404

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

Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!