Here are two approaches, both of which require familiarity with the configuration of the convention.php page.
One is to modify error_page This configuration item, this place is recommended to use absolute path, because the path with relative path is the current error page, may not be able to navigate to the page you expect to arrive.
Path:/123.56.183.226/web/thinkphp/conf/convention.php
The above representative's configuration will jump to Baidu's homepage when the site access fails. Of course this is not think PHP officially encouraged by the operation, the official does not encourage you to make any changes to the convention.php file, because this file is a custom file, but allows you to overwrite the configuration here, so it is recommended to choose the following practice .
The other is the modification of the failed template defined in Tmpl_exception_file, in which you can write directly to the failed detail page, or you can add the function (header ()) of the page jump to the extension.
Path:/123.56.183.226/web/thinkphp/conf/convention.php
It should be noted that the 404 jumps of both methods must be in non-debug mode:
Path:/123.56.183.226/index.php
In both methods, if error_page is defined, the Tmpl_exception_file is no longer called
Thinkphp's failure page (404)