dedecms5.7 网站首页自动添加index.html
除掉方法
为了几种权重,为了美观,现在我们都不怎么想看到index.html结尾的网站,那么怎么把index.html不出现了,下面就是TC收集的两种dedecms修改方法给大家做为参考。windows主机的解决办法:
将空间或者服务器的默认首页,从index.php优先改为index.html优先,用iis服务器的,只要在空间首页设置里面把index.html放在index.php前面即可。
linux主机的解决办法:
在站点根目录建立.htaccess文件
然后在里面加这些内容:DirectoryIndex index.html index.htm index.php
网上提供的第二种方法
将网站根目录index.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 `dede_homepageset`");
$row['templet'] = MfTemplet($row['templet']);
$pv = new PartView();