If your page appears 301 or 404 for the user experience is a very serious problem, so we do php header301 or 404 must be careful and careful, and I came to see.
301 Jump
The code is as follows |
Copy Code |
Header (' http/1.1 301 Moved permanently '); Header (' location:http://www.abc.com/aaa/'); Exit (); |
Do not miss the header (' http/1.1 301 Moved permanently '); Or you can't return 301.
404 error page
The code is as follows |
Copy Code |
Header ("http/1.1 404 Not Found"); |
If the above does not work, you can try the following:
The code is as follows |
Copy Code |
Header ("status:404 not Found"); |
So in order to be foolproof, can be written in two sentences:
The code is as follows |
Copy Code |
Header ("http/1.1 404 Not Found"); Header ("status:404 not Found"); |
Tips,
If we write the code we have to use webmaster tools to test the return status is not what we want oh.
http://www.bkjia.com/PHPjc/633119.html www.bkjia.com true http://www.bkjia.com/PHPjc/633119.html techarticle If your page appears 301 or 404 for the user experience is a very serious problem, so we do php header301 or 404 must be careful and careful, and I came to see. ...