织梦去掉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();?>