时间:2021-07-01 10:21:17 帮助过:3人阅读
代码如下:
$the_host = $_SERVER['HTTP_HOST'];
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
if($the_host !== 'www.gxlcms.com')
{
//echo $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.gxlcms.com' . $_SERVER['PHP_SELF'] . $request_uri);
}
?>
http://www.bkjia.com/PHPjc/825209.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/825209.htmlTechArticlePHP 301跳转的小代码 代码如下:?php $the_host = $_SERVER['HTTP_HOST']; $request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; if($the_h...