织梦DEDECMS网站模板的一些SEO优化技巧
我们织梦模板团来介绍下织梦DEDECMS网站模板的一些SEO优化技巧:
一、网站静态设置
你可以在后台管理中开启伪静态设置,但是开启伪静态对主机要求有点高。当然也可以实现整站的静态化,具体操作方法这里就不做赘述,大家可以在网上找dede仿站。
二、网站URL路径优化
1.首页URL的路径优化。大家安装程序后,也许会发现打开首页后其路径是这样的:http://www.51fangzhan.com/index.html,这种路径远没有http://www.51fangzhan.com/路径好。那么怎么去掉后面的index.html呢?具体方法是将根目录下的index.php文件中的 www.51fangzhan.com
<?php
if(!file_exists(dirname(__FILE__).'/data/common.inc.php'))
{
header('Location:install/index.php');
exit();
}
//自动生成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']);
$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");
仿站咨询扫二维码


仿站教程推荐
- 相关链接:
- 教程说明:
织梦DEDECMS网站模板的一些SEO优化技巧
。