Dede默認生成首頁后,首頁的鏈接后面會多出一個index.html。據官方說法這樣有利于網站優(yōu)化。
但是這個index.html怎么看都不舒服,而且也不利于seo中主頁url的統(tǒng)一。因為我的網站的url用.htaccess轉向統(tǒng)一都是www,而帶.com結尾的。 所以出于不讓首頁權重分散考慮,同時也是美觀考慮,dede首頁的index.html還是得去掉好。 網上給出的dede首頁去掉index.html的方法如下: 1.按官方給的更新說明 替換index.php的內容 生成動態(tài), 如果首頁不需要生成HTML的, 把index.php換成下面代碼<?phpif(!file_exists(dirname(__FILE__).'/data/common.inc.php')){header('Location:install/index.php');exit();}require_once (dirname(__FILE__) . "/include/common.inc.php");require_once DEDEINC."/arc.partview.class.php";$GLOBALS['_arclistEnv'] = 'index';$row = $dsql->GetOne("Select * From `dede_homepageset`");$row['templet'] = MfTemplet($row['templet']);$pv = new PartView();$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);$pv->Display();?> 當然如果要生成html就不行了。 2.直接刪除CMS根目下的index.php文件,新聞熱點
疑難解答
圖片精選