织梦怎么去掉index.html

   2025-07-29 admin00110

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

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

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

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

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

立即学习“前端免费学习笔记(深入)”;

<?phpif(!file_exists(dirname(__FILE__).'/data/common.inc.php')){header('Location:install/index.php');exit();}require_once(dirname(__FILE__)."/include/common.inc.php");require_onceDEDEINC."/arc.partview.class.php";$GLOBALS['_arclistEnv']='index';$row=$dsql->GetOne("Select*From`dede_homepageset`");$row['templet']=MfTemplet($row['templet']);$pv=newPartView();$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$row['templet']);$pv->Display();?>
 
举报收藏 0打赏 0评论 0
 
更多>同类资讯
推荐图文
推荐资讯
点击排行
网站首页  |  关于我们  |  联系方式  |  用户协议  |  隐私政策  |  版权声明  |  网站地图  |  RSS订阅  |  京ICP备2024057451号-2