织梦首页index.html如何去掉?
很多朋友在使用织梦建站或者仿站时都会发现,在访问首页时后面都会添加上index.html
推荐学习:织梦cms
原代码
代码如下:
//自动生成HTML版 if(isset($_GET['upcache'])) { 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->SaveToHtml(dirname(__FILE__).'/index.html'); include(dirname(__FILE__).'/index.html'); exit(); } else { header('HTTP/1.1 301 Moved Permanently'); header('Location:index.html'); } ?>
把上面的代码替换为
代码如下:
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(); ?>
然后就可以了。
原文链接:https://www.f2er.com/dedecms/534177.html