Php301 redirection code _ PHP Tutorial

Source: Internet
Author: User
Php301 redirection code. The best way to change the address of a webpage to be friendly to search engines is to perform 301 redirection. if you do not temporarily transfer one or more webpages, we all think that the best way to make 301 redirection to compare with changing the address of a webpage to be friendly to search engines is to do 301 redirection. if you do not temporarily transfer one or more webpages, we all think that 301 redirection is more appropriate.

The best way to change the webpage address to be friendly to search engines is to perform 301 Redirection. if you do not temporarily transfer a webpage or some webpages, we all think that 301 redirection is more appropriate.

The following 301 redirection code is commonly used in php tutorials:

Header ("http/1.1 301 moved permanently ");
Header ("location: http://www.bKjia. c0m /");
?>

301 redirection is a permanent redirection. when a user or search engine sends a browser request to our website, the website server will return the http data stream, the data stream header information (header) contains a status code. "301" indicates a status code that permanently transfers the webpage to another address.

Notes, about header functions

Header (string, replace, http_response_code)

The header () function sends the original http header to the client.

It is important to realize that the header () function must be called before any actual output is sent (in php 4 and later versions, you can use the output cache to solve this problem):

...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.