织梦DEDECMS首页删除index.html后缀尾巴的方法

  织梦DEDECMS首页删除index.html后缀尾巴的方法

  默认的DEDECMS首页生成静态后,打开我们所用DEDECMS搭建的网站会在域名后面加上index.html路径,一来看的不是太美观,而来传言对SEM有所影响。

  那就得想办法去掉,最简单的方法就是把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没有了。

© 版权声明
THE END
喜欢就支持以下吧
点赞0赞赏
分享
相关推荐
  • 暂无相关文章
评论 抢沙发