织梦怎么去掉index.html

 2784

织梦去掉index.html的方法:首先打开DEDECMS根目录下的index.PHP文件;然后替换内容为“if(!file_exists(dirname(__FILE__).'/data/common.inc.php')){..}”即可。


织梦怎么去掉index.html


织梦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__).'/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了,有疑问可以联系我。


如果不想用上述方法,以万网虚拟主机为例(下图):将默认首页index.htm移到最上面,最高优先级,保存设置,在网站后台更新主页就没有index.html了。


织梦怎么去掉index.html


TAG标签:
本文网址:https://www.zztuku.com/detail-8864.html
站长图库 - 织梦怎么去掉index.html
申明:如有侵犯,请 联系我们 删除。

评论(0)条

您还没有登录,请 登录 后发表评论!

提示:请勿发布广告垃圾评论,否则封号处理!!

    编辑推荐