This article mainly introduces how to set up ThinkPHP 404 page. Friends who need it can refer to it
When 404 pages are used in many websites, how to set them in the ThinkPHP framework? Next, I will introduce one of the methods
1. First, create the EmptyAction.class.php module under Lib/Action
The content is as follows:
The code is as follows:
2. After completing the above processing, the 404 page can only be accessed when the empty module is accessed. Therefore, in order to access the empty method and the 404 page, we also need to add an empty method to CommonAction.class.php , the method is as follows:
The code is as follows:
3. After completing the above work, it is basically OK, but don’t forget to put your 404.html page under Tpl/Public
That’s ok, okay, let’s close the team, close the team! ~~~