Thinkphp makes a simple implementation of 404 jump pages, thinkphp makes 404 jump pages

Source: Internet
Author: User

Thinkphp makes a simple implementation of 404 jump pages, thinkphp makes 404 jump pages

There are many thinkphp 404 page creation methods on the Internet, but most of them are too cumbersome, not convenient, and annoying. So I shared the most convenient 404 creation method for you, as shown below.
Add configuration items in the config configuration file of the public directory of thinkphp:

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

The content of 404.html created in the publicfolder is as follows:

<! DOCTYPE html> 

This is done. Of course, the status code is 404, because thinkphp returns 404 if the page does not exist by default! Finally, I would like to recommend a source code community named the original source code library. A good website may help you!

The above is all the simple implementation of thinkphp's 404 page Jump Method for everyone. I hope it will be helpful to you and support more help ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.