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...