The 404 page is a way to tell the search engine that this page does not exist. It also prompts the user to choose other operations. Now I will introduce the operation method of customizing the 404 page in PHP to friends who do not have apache operation permission.
Method 1
The code is as follows
代码如下 |
复制代码 |
@header("http/1.1 404 not found");
@header("status: 404 not found");
echo 'echo 404';
exit();
|
|
Copy code
|
代码如下 |
复制代码 |
@header("http/1.1 404 not found");
@header("status: 404 not found");
include("../../404.htm");
exit();
|
@header("http/1.1 404 not found");
@header("status: 404 not found");
echo 'echo 404';
exit();
代码如下 |
复制代码 |
errordocument 404 /404.html
|
Loads a 404 error page
代码如下 |
复制代码 |
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 xxxxxxx |
The code is as follows
|
Copy code
|
代码如下 |
复制代码 |
ErrorDocument 404 /404.htm |
|
@header("http/1.1 404 not found");
@header("status: 404 not found");
include("../../404.htm");
exit();
You can also add the .htaccess code to your site as follows
The code is as follows
|
Copy code
|
errordocument 404 /404.html
If we have apahce configuration permission, we can modify httpd.conf
The code is as follows
|
Copy code
|
#ErrorDocument 500 "The server made a boo boo ."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 xxxxxxx
Modify to
http://www.bkjia.com/PHPjc/628782.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/628782.htmlTechArticleThe 404 page tells the search engine that this page does not exist, and also prompts the user to choose other operations. Now let me introduce customization in php to friends who do not have apache operating rights...
|
|
|