怎么去掉dedecms织梦首页后面的index.html?大家知道dedecms系统按照默认的设置安装后,访问首页时候,域名后面总跟随着一个/index.html的后缀,看起来域名变得很长了,另一个也不利于优化,首页权重会分散。 当然,有的空间可能默认显示的就是没带index.html,那么就不用考虑这个问题了。
今天说下两种方法可以实现: 第一种: 虚拟主机的话,就是在你的空间控制面板中,将index.html默认首页的优先级设为最高。一般的空间都会提供这种功能。还有以IIS6为例,在IIS里右键属性-文档,添加index.html,移动到最上面。如图:

第二种:我们找到dede根目录下的index.php文件: 复制以下代码,然后替换index.php里的代码: 1 | <span style="margin: 0px; padding: 0px; outline: none; list-style-type: none; border: none; font-size: 14px; color: rgb(110, 110, 110); font-family: Verdana, 'Arial Narrow', 宋体, 'Microsoft Yahei', 微软雅黑, 'Helvetica Neue', Helvetica, Arial, sans-serif, Simsun, 'Segoe UI'; line-height: 20px;"><span style="margin: 0px; padding: 0px; outline: none; list-style-type: none; border: none;">require_once(dirname(__FILE__) . "/include/common.inc.php"); |
|