大家知道,使用织梦做站,网址后面都会出现index.html这个后缀,虽然不影响SEO,但是也很不好看!
在正常情况,有两个地方会出现index.html,一个是首页自动跳转到index.html,还有一个是在导航的栏目中,下面给大家说说怎么去掉这个index.html。
最简单的方法就是把DedeCms根目录下的index.php内中的代码全部替换成如下:
-
<?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没有了。