linux的主机做301 404都很简单,但是win的虚拟主机就有点麻烦了;今天分享下win虚拟主机做301的方法
其实也非常简单,在init.php 或者index.php中加入
if (strtolower($_SERVER['SERVER_NAME'])!='www.qbige.com'){
$URIRedirect=$_SERVER['REQUEST_URI'];
if(strtolower($URIRedirect)=="/index.php"){
$URIRedirect="/";
}
header('HTTP/1.1 301 Moved Permanently');
header('Location:http://www.qbige.com'.$URIRedirect);
exit();
}
就完成了
非常简单。。。
其他阅读:ecshop title优化