Warning: Undefined array key "night" in /www/wwwroot/dhaomu.com/wp-content/themes/b2/header.php on line 18

织梦教程如何去掉DedeCMS首页域名后面的index.html

织梦DedeCMS教程如何去掉首页域名后面的index.html!今天我的一朋友和我做友情连接的时候对我说请把你的域名尾巴去掉。

织梦DedeCMS教程如何去掉首页域名后面的index.html!今天我的一朋友和我做友情连接的时候对我说请把你的域名尾巴去掉。

那样影响权重的我这才知道网站首页默认是带index.html的后缀,从seo的角度来说这样很不好,分散了网站的权重。这样就会影响网站的排名.于是我就在百度搜索解决办法…

如果首页不需要生成HTML的

登录FTP打开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();
/*

//自动生成HTML版

if(isset($_GET['upcache']))
{
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']);
echo $row['templet'];
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
$pv->SaveToHtml(dirname(__FILE__).'/index.html');
include(dirname(__FILE__).'/index.html');
exit();
}
else
{
header('HTTP/1.1 301 Moved Permanently');
header('Location:index.html');
}
*/
?>

全部替换为以下代码:

<?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();
?>

第二种方法

很多用户希望顶部导航连接便于SEO,需要去除超链接中的“index.html”,我们可以在这里对标签进行一个修改:

{dede:channel type='top'}
<li><a href='[field:typeurlfunction='str_replace("index.html","",@me)'/]'>[field:typename/]</a></li> {/dede:channel}

第三种方法:

直接首页生成静态后把index.php 修改为 index.php_ 或者 index-.php 等等随你的便。只要不是 index.php 就OK了。怎么样?解决了织梦DedeCMS如何去掉首页域名后面的index.html的问题了吧。

但是这几种确不是最根本最简单的解决办法请大家不要被他们所误导,现在我就给大家介绍个最基本最简单的办法(也是朋友告诉我的)。

大家只需要在空间管理里修改默认首页为index.html (用服务器的朋友在服务器里上移到第一位就OK。。)并且放在第一位就OK了问题就这么简单.以后大家碰上问题不要盲目的使用别人的办法有关自己去钻研多学多问别乱改动哟““

温馨提示:
1.本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:duhaomu@163.com,我们将第一时间处理!
2.资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持。
3.所有资源仅限于参考和学习,版权归原作者所有,更多请阅读网站声明

给TA赞赏
共{{data.count}}人
人已赞赏
编程技巧

Regex技术正则表达式匹配正整数

2015-11-18 9:00:00

编程技巧

EcShop教程安装遇到安装数据失败的解决方法

2015-12-2 9:00:00

0 条回复 A文章作者 M管理员

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914
----《》
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索