<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 14-3-7
* Time: 下午3:20
*/
$root=$_SERVER['HTTP_HOST'];
if(!strstr($root,"www.")){
$_SERVER['HTTP_HOST']="www.".$_SERVER['HTTP_HOST'];
$request_uri=$_REQUEST['REQUEST_URI'];
header('HTTP/1.1 301 Moved Permanently');//发出301头部
header('Location: http://'.$_SERVER['HTTP_HOST'].$request_uri);//跳转到我的新域名地址
exit();
}
?>