POST TIME:2020-04-12 22:38
把上邊的代碼加入到首頁index.php中//主域名301跳轉到www $redirect301=1; //301跳轉開關,1代表打開,0代表關閉 $index_file='index.html';
//指定網站默認首頁文件,DeDeCMS設置為index.html,不支持SSI(shtml/shtm) if(substr($_SERVER['SERVER_NAME'],0,4)!='www.'&&$redirect301)
//判斷URL中是否帶www { header('HTTP/1.1 301 Moved Permanently'); header('Location:http://www.'.$_SERVER['SERVER_NAME']); //301跳轉到www exit(); }
的上邊。if(!file_exists(dirname(__FILE__).'/data/common.inc.php'))