301 page to php, 301 page to _ PHP Tutorial

Source: Internet
Author: User
301 page to php, 301 page. 301 page to php, 301 page to new 301. php page, in the program entry file index. php reference 301. php page 301. php content is as follows, for reference only :? Php $ the_host $ _ SERVER [HTTP 301 page to php, 301 page

Create the 301. php page and reference the 301. php page in the program entry file index. php.

301. The php content is as follows for reference only:

$ The_host = $ _ SERVER ['http _ host']; // Obtain the current domain name
$ The_url = isset ($ _ SERVER ['request _ URI '])? $ _ SERVER ['request _ URI ']: ''; // judge the part after the address
$ The_url = strtolower ($ the_url); // convert the English letters to lowercase letters.
If ($ the_url = "/index. php") // You can check whether the homepage is correct.
{
$ The_url = ""; // if the homepage is displayed, the value is null.
}
If ($ the_host! = 'Www .baidu.com ') // if the domain name is not a url with www, perform the following 301 jump
{
Header ('http/1.1 301 Moved Permanently '); // issue the 301 header
Header ('Location: http://www.baidu.com '. $ the_url); // jump to the URL with www
}
?>

On the login php, 301 page, go to the new 301. php page. in the program entry file index. php reference 301. php page, the content of 301. php is as follows, which is for reference only :? Php $ the_host = $ _ SERVER ['http...

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.