织梦访问首页时地址后的index.html该如何去掉

现在我就把这解决办法分享出来,大家可以试一试,看有没有用 

 

在www/ 跟目录下有个自带的index.php文件 

原代码 

 

//自动生成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(); ?>  

然后就可以了。 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/98aa7a304aebbd47dc63a14df16e257f.html