signed

QiShunwang

“诚信为本、客户至上”

如何去掉织梦网站首页后面的index.html

2021/4/26 19:21:19   来源:

再就是服务器或者主机上把默认主页改成“index.html”

为了能够永久的不显示,你最后还要改一下程序代码:

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

原代码 为:

01//自动生成HTML版
02if(isset($_GET['upcache']))
03{
04require_once (dirname(__FILE__) . "/include/common.inc.php");
05require_once DEDEINC."/arc.partview.class.php";
06$GLOBALS['_arclistEnv'] = 'index';
07$row = $dsql->GetOne("Select * From `dede_homepageset`");
08$row['templet'] = MfTemplet($row['templet']);
09$pv = new PartView();
10$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
11$pv->SaveToHtml(dirname(__FILE__).'/index.html');
12include(dirname(__FILE__).'/index.html');
13exit();
14}
15else
16{
17header('HTTP/1.1 301 Moved Permanently');
18header('Location:index.html');
19}
20?>

 

以上代码改成:

1require_once (dirname(__FILE__) . "/include/common.inc.php");
2require_once DEDEINC."/arc.partview.class.php";
3$GLOBALS['_arclistEnv'] = 'index';
4$row = $dsql->GetOne("Select * From `dede_homepageset`");
5$row['templet'] = MfTemplet($row['templet']);
6$pv = new PartView();
7$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
8$pv->Display();
9?>

 

这样你再去看就解决问题了~~代码好难写,希望采纳