301跳转
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.url.com' . $_SERVER['PHP_SELF'] . $request_uri);
加强版(有判断)
$the_host = $_SERVER['HTTP_HOST'];
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
if($the_host !== 'www.demo.com') {
//echo $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.demo.net' . $_SERVER['PHP_SELF'] . $request_uri);
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。