Posted in PHP onNovember 25, 2013
PHP 301跳转的小代码
<?php $the_host = $_SERVER['HTTP_HOST']; $request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; if($the_host !== '3water.com') { //echo $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; header('HTTP/1.1 301 Moved Permanently'); header('Location: https://3water.com' . $_SERVER['PHP_SELF'] . $request_uri); } ?>
php用header函数实现301跳转代码实例
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@