如何去掉织梦dedecms主页地址栏中的index.html的方法

首先,找到织梦dedecms网站根目录下的index.php文件,将里面的全部代码:
<?php
if(!file_exists(dirname(__FILE__).’/data/common.inc.php’))
{
header(‘Location:install/index.php’);
exit();
}
//自动生成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 `#@__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’);
}
?>

替换成:
<?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.html已经消失了,即使你从后台点击“更新主页HTML”以后,index.html也不会出现了。

One comment

Add Comment

Required fields are marked *. Your email address will not be published.