In phpcms, if you encounter a topic or content that you do not have, you are prompted that there is no relevant information, but the returned status code is still 200, which is not effective in optimization,
How to implement it is actually simple. The operation steps are as follows:
First, create a page404.php file in the root directory of the website,
[Php]
<? Php
Header ('HTTP/1.1 404 Not found ');
?>
Page 404
<? Php
Header ('HTTP/1.1 404 Not found ');
?>
Page 404
In phpcms/module/content/index. php, find lists and show.
[Php]
If (! $ Catid |! $ Id)
Header ('location:/page404.php ');
If (! Isset ($ CATEGORYS [$ catid]) | $ CATEGORYS [$ catid] ['type']! = 0)
Header ('location:/page404.php ');
If (! $ R | $ r ['status']! = 99)
Header ('location:/page404.php ');
If (! $ Catid |! $ Id)
Header ('location:/page404.php ');
If (! Isset ($ CATEGORYS [$ catid]) | $ CATEGORYS [$ catid] ['type']! = 0)
Header ('location:/page404.php ');
If (! $ R | $ r ['status']! = 99)
Header ('location:/page404.php ');
In lists:
If (! Isset ($ CATEGORYS [$ catid])
Header ('location:/page404.php ');
In this way, the returned status code is correct.