301,302 is the encoding of the HTTP state, which means that a URL has shifted, except that 301 represents a permanent transfer (permanently Moved) and 302 represents a transient transfer (temporarily Moved).
301 redirect is the best way to search engine friendly after changing the address of the webpage, as long as it is not temporarily moved, it is recommended to use 301来 to do forwarding address, if we put an address using 301 jump way, the search engine will take the old address of PageRank and other information to the new address, At the same time in the Search engine index library to completely discard the original old address.
In PHP, the general implementation of the page jump statement is as follows:
PHP header (' location:http://www.wuwx.cn/');
When we use the tool to view this HTTP header, we find that he returned an HTTP 302 temporary redirect. Instead of the HTTP 301 permanent redirect that we expect, note the first line of fancy:
How should HTTP 301 permanent redirection be implemented? It is also very simple, just add a line of code:
PHP header (' http/1.1 301 Moved permanently ');
Header (' location:http://www.wuwx.cn/');
When we look at the HTTP header of this page again, he returns the HTTP 301 permanent redirect that we expected.
http://www.bkjia.com/PHPjc/364084.html www.bkjia.com true http://www.bkjia.com/PHPjc/364084.html techarticle 301,302 is the HTTP status of the encoding, all means that a URL has been transferred, the difference is that: 301 for permanent transfer (permanently Moved), 302 for temporary transfer (Temporaril ...