Let's introduce a module about thinkphp Access does not exist jump to page 404 you need a friend to refer to.
Create a new file in the action EmptyAction.class.php, the code in the file is as follows:
The code is as follows |
Copy Code |
Class Emptyaction extends action{ function _empty () { Header ("http/1.0 404 Not Found");//make HTTP return 404 status Code $this->display ("public:404"); } } ?> |
Set in Apache
Add ErrorDocument 404/404.html to your site configuration.
In IIS, set the
iis/asp.net Setting the 404 error page
Open the Apache httpd.conf configuration file or create a new. Htaccess profile
First, modify the settings of the application root to open the "Web. config" file editor, adding the following:
The code is as follows |
Copy Code |
|
Note: In the example above, "error.asp" is the default 404 page of the system, "notfound.asp" is a custom 404 page, please modify the corresponding file name when using.
Then, in the Custom 404 page "Notfound.asp", add:
The code is as follows |
Copy Code |
<% Response.Status = "404 Not Found" %> |
PHP 404
The code is as follows |
Copy Code |
if (if there is no result) { Previously, only the "this post no longer exists" prompt, is now: Require ('/404.php '); @header (' http/1.1 404 Not Found '); @header (' status:404 not Found '); Exit } |
http://www.bkjia.com/PHPjc/444652.html www.bkjia.com true http://www.bkjia.com/PHPjc/444652.html techarticle let's introduce a module about thinkphp Access does not exist jump to page 404 you need a friend to refer to. Create a new file in action EmptyAction.class.php, the code in the file ...