Dede默认生成首页后,首页的链接后面会多出一个index.html。
据官方说法这样有利于网站优化。 但是这个index.html怎么看都不舒服,而且也不利于seo中主页url的统一。
所以出于不让首页权重分散考虑,同时也是美观考虑,dede首页的index.html还是得去掉好。
网上给出的dede首页去掉index.html的方法如下:
按官方给的更新说明 替换index.php的内容 生成动态:
如果首页不需要生成HTML的, 把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
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有