织梦怎么去掉index.html

 2021-05-12 15:10:37  ADMIN
织梦去掉index.html的方法:首先打开dedecms根目录下的index.php文件;然后替换内容为“if(!file_exists(dirname(__file__).'/data/common.inc.php')){..}”即可。

织梦怎么去掉index.html

本文操作环境:windows7系统、DedeCMS5.6版,DELL G3电脑

织梦cms去掉网站首页后缀index.html方法

搜索引擎会认为/和/index.htm是两个不同的页面,输入域名马上就转接到www.dede58.com/index.html的,这样路径变长,也不利于SEO,还会分散权重,默认的DEDECMS首页生成静态后,打开我们所用DEDECMS搭建的网站会在域名后面加上index.html路径,一来看的不是太美观,二来传言对SEO有所影响。

最简单最好的方法就是把DEDECMS根目录下的index.PHP内中的代码全部替换成如下:

<?php  
    if(!file_exists(dirname(__FILE__).&#39;/data/common.inc.php&#39;))  
    {  
         header(&#39;Location:install/index.php&#39;);  
         exit();  
    }  
    require_once (dirname(__FILE__) . "/include/common.inc.php");  
    require_once DEDEINC."/arc.partview.class.php";  
    $GLOBALS[&#39;_arclistEnv&#39;] = &#39;index&#39;;  
    $row = $dsql->GetOne("select * From `dede_homepageset`");  
    $row[&#39;templet&#39;] = MfTemplet($row[&#39;templet&#39;]);  
    $pv = new PartView();  
    $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row[&#39;templet&#39;]);  
    $pv->Display();  
?>
登录后复制
x

在线咨询

微信客服

售后技术

QQ咨询