前不久新域名备案通过了,就把博客的主域名改为新域名了,旧域名做了带参数301,代码如下

<?php
$request_url = 
isset($_SERVER['REQUEST_URL']) ? $_SERVER['REQUEST_URL'] : '';
//如有参数存入变量

header('HTTP/1.1 301 Moved Permanently');
//返回301码

header('Location: https://cwlog.net'.$request_url);
//跳转新域名

标签: none

添加新评论