PHP 301 redirect Code _php Tutorial

Source: Internet
Author: User
Web page changes to the search engine friendly after the best way to do is to do 301 redirect, if not temporarily to some or some of the Web page transfer, we all think to do 301 redirect more appropriate.

Web page changes to the search engine friendly after the best way to do is to do 301 redirect, if not temporarily to some or some of the Web page transfer, we all think to do 301 redirect more appropriate.

The following PHP tutorial Common 301 Redirect Code

Header ("http/1.1 301 Moved Permanently");
Header ("location:http://www.bkjia.c0m/");
?>

301 redirects are permanent redirects, when a user or search engine sends a browse request to our website, the Web server returns the HTTP data stream, which contains a status code in the header, and 301 is a status code that represents the permanent transfer of this page to another address.

Notes, about the header function

Header (String,replace,http_response_code)

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

It is important to recognize that the header () function must be called before any actual output is sent (in PHP 4 and later, you can use output caching to resolve this issue):

http://www.bkjia.com/PHPjc/632350.html www.bkjia.com true http://www.bkjia.com/PHPjc/632350.html techarticle Web page change address after the best way to search engine friendly is to do 301 redirect, if not temporarily to some or some of the page transfer, we all think do 301 redirect comparison ...

  • Related Article

    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.