您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

织梦怎么去掉index.html

2024/5/17 23:25:00发布24次查看
织梦去掉index.html的方法:首先打开dedecms根目录下的index.php文件;然后替换内容为“if(!file_exists(dirname(__file__).'/data/common.inc.php')){..}”即可。
本文操作环境: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__).'/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了。
推荐学习:《dedecms教程》
以上就是织梦怎么去掉index.html的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product