404 page is the page that the client returns when browsing the Web page, because the server is unable to provide information properly, or the server is unable to respond and does not know the reason. 404 bearer of the user experience and SEO optimization of the task. 404 pages typically give a user access to a page that does not exist on the site or is deleted, and the server returns a 404 error. If the webmaster does not set 404 pages, there will be dead links, spiders crawling such URLs, is not conducive to search engine included, is a site necessary page.
404 error message is usually the target page is changed or removed, or the client Input page address error after the page display, if the direct display of 404 pages or abnormal error, the user experience is very unfriendly to the visitor, so we need to customize a 404 page (Exception handling page).
Error Exception Page Setup
1. Create an exception-handling class:
* Custom classes need to inherit handle and implement the Render method
2. Set the custom error handling page in the configuration file
* To enable custom error handling pages, you first have to set debug in the config.php file to False, otherwise the custom error page will not work properly.
Make the following configuration in the config.php file
After you have completed the above settings, visit the page that you just
You can see that the custom exception handling page has been implemented.
Two great benefits of setting up 404 pages
1, guide users do not close the site, enhance the user experience.
2, prevent the website to appear dead link.
Of course, you can do more beautiful and featured guide page, this article only shared the thinkphp5.0 how to implement the custom 404 page, welcome more friends attention, communication!
Thinkphp 5.0 How to implement a custom 404 (exception handling) page