我们有在使用织梦DedeCMS程序的时候是否有看到在打开网站首页的时候会有index.html这样子的后缀跟着。有些朋友可能忌讳这样的样式,有的会说对网站SEO有影响,实际上影响是不大的,只不过看着确实不是特别好看,如果我们有需要去掉的话也是可以的。
这里有几个方法可以去掉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'}
  • [field:typename/]
  • {/dede:channel}

    一般index.html是因为被导航链接调用带着出来的,如果我们不点击打开就不会看到,所以我们可以修改导航,不调用。


    扫描二维码,在手机上阅读!