ECSHOP用php程序进行301重定向

发布时间:2013-07-29 08:09:10
打开includes/init.php,在最开头加入下面代码:
 
if (strtolower($_SERVER['SERVER_NAME'])!='www.xkcms.net'){
$URIRedirect = $_SERVER['REQUEST_URI'];
if(strtolower($URIRedirect)=="/index.php"){
 $URIRedirect = "/";
}
header('HTTP/1.1 301 Moved Permanently');
header('Location:http://www.xkcms.net'.$URIRedirect);
exit();
}
php