这里有几个方法可以去掉DedeCMS生成首页后的index.html。
1、更换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_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();
?>我们可以将index.php内容全部换成上面内容。
2、修改导航
{dede:channel type='top'}
<li><a href='[field:typeurlfunction='str_replace("index.html","",@me)'/]'>[field:typename/]</a></li> {/dede:channel}一般index.html是因为被导航链接调用带着出来的,如果我们不点击打开就不会看到,所以我们可以修改导航,不调用。