大家知道,使用織夢做站,網(wǎng)址后面都會出現(xiàn)index.html這個后綴,雖然不影響SEO,但是也很不好看!
在正常情況,有兩個地方會出現(xiàn)index.html,一個是首頁自動跳轉(zhuǎn)到index.html,還有一個是在導(dǎo)航的欄目中,下面給大家說說怎么去掉這個index.html。
最簡單的方法就是把DedeCms根目錄下的index.php內(nèi)中的代碼全部替換成如下:
-
<?php
-
if(!file_exists(dirname(__FILE__).'/data/common.inc.php'))
-
{
-
header('Location:install/index.php');
-
exit();
-
}
-
require_once(dirname(__FILE__)."/include/common.inc.php");
-
require_onceDEDEINC."/arc.partview.class.php";
-
$GLOBALS['_arclistEnv']='index';
-
$row=$dsql->GetOne("Select*From`dede_homepageset`");
-
$row['templet']=MfTemplet($row['templet']);
-
$pv=newPartView();
-
$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$row['templet']);
-
$pv->Display();
-
?>
替換后清空下瀏覽器緩存,然后再打開看看,是不是index.html沒有了。