上一篇:站长统计过滤自己的IP
下一篇:《赶紧给爸妈打电话……》这张请假条,看哭众多学生和家长
老司机都知道的301用途,新手不知道的可以去问度娘这里就不解说了
用DW或者np++打开根目录index.php,,,,,,,修改的时请先备份。
把这代码插入到这里并修改为你的域名
代码如下:
$the_host = $_SERVER['HTTP_HOST'];
$the_url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
$the_url = strtolower($the_url);
if($the_url=="/index.php")
{
$the_url="";
}
if($the_host == 'xxxxx.com')//xxxxx修改成顶级域名
{
header('HTTP/1.1 301 Moved Permanently');
header('Location:http:// www.xxxxx.com'.$the_url);//xxxxx修改成要跳转到的二级域名
}