wordpress最有效的简单301重定向方法
March 23rd, 2010
No comments
意外常常发生,所以有备无患。
- 打开根目录,打wp-blog-header.php
- 把以下代码放在最上面。over
if (strtolower($_SERVER['SERVER_NAME'])!=’www.action-01.cn’)
{
$URIRedirect=$_SERVER['REQUEST_URI'];
if(strtolower($URIRedirect)==’/index.php’) {
$URIRedirect=’/';
}
header(‘HTTP/1.1 301 Moved Permanently’);
header(‘Location:http://www.action-01.cn’.$URIRedirect);
exit();
}