The 404 page tells the search engine that the page does not exist, and also prompts users to select other operations. next I will introduce php custom 404 to my friends who do not have apache operation permissions.
The 404 page tells the search engine that the page does not exist and also prompts you to select other operations, next, I will introduce my friends who do not have the apache operation permission to the operations on the custom 404 page in php.
The instance code is as follows:
- @ Header ("http/1.1 404 not found ");
- @ Header ("status: 404 not found ");
- Echo 'echo 404 ';
- Exit ();
Load a 404 error page
The instance code is as follows:
- @ Header ("http/1.1 404 not found ");
- @ Header ("status: 404 not found ");
- Include ("../404.htm ");
- Exit ();
You can also add. htaccess to the site. the instance code is as follows:
- Errordocument 404/404 .html
If you have the permission to configure apahce, you can modify httpd. conf and find:
The instance code is as follows:
- # ErrorDocument 500 "The server made a boo ."
- # ErrorDocument 404/missing.html
- # ErrorDocument 404 "/cgi-bin/missing_handler.pl"
- # ErrorDocument 402 xxxxxxx
Change
The instance code is as follows:
- ErrorDocument 404/404 .htm