织梦CMS的列表伪静态的设置方法

动态可以显示实时信息,但静态却可以减少服务器资源的耗费,更因为搜索引擎的爱好静态,我们很多的站长都是以静态的方式来生成整站的。有没有什么好的方法,可以让鱼和熊掌兼得呢?那就需要伪静态技术了,本节内容将向大家介绍如何打开织梦CMS列表的伪静态的

动态可以显示实时信息,但静态却可以减少服务器资源的耗费,更因为搜索引擎的爱好静态,我们很多的站长都是以静态的方式来生成整站的。有没有什么好的方法,可以让鱼和熊掌兼得呢?那就需要伪静态技术了,本节内容将向大家介绍如何打开织梦CMS列表的伪静态的方法。


如何打开织梦列表页的伪静态呢?下面是详细的步骤:

打开inc_arclist_view.php
查找
//---------------------------------
//获取动态的分页列表
//---------------------------------

对比以下代码修改
function GetPageListDM($list_len,$listitem="index,end,pre,next,pageno")
{
$prepage="";
$nextpage="";
$prepagenum = $this->PageNo-1;
$nextpagenum = $this->PageNo+1;
if($list_len==""||ereg("[^0-9]",$list_len)) $list_len=3;
$totalpage = ceil($this->TotalResult/$this->PageSize);
if($totalpage<=1 && $this->TotalResult>0) return "共1页/".$this->TotalResult."条记录";
if($this->TotalResult == 0) return "共0页".$this->TotalResult."条记录";
$maininfo = "共{$totalpage}页/".$this->TotalResult."条记录";

$purl = $this->GetCurUrl();
$geturl = "typeid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
$gettypeid =$this->TypeID."-";
//$hidenform = "<input type='hidden' name='typeid' value='".$this->TypeID."'>\r\n";
//$hidenform .= "<input type='hidden' name='TotalResult' value='".$this->TotalResult."'>\r\n";

$purl .= "?".$geturl;

//获得上一页和下一页的链接
if($this->PageNo != 1){
$prepage.="<a href='list-".$gettypeid."$prepagenum.html'>上一页</a>";
$indexpage="<a href='list-".$gettypeid."1.html'>首页</a>";
}
else{
$indexpage="首页";
}

if($this->PageNo!=$totalpage && $totalpage>1){
$nextpage.="<a href='list-".$gettypeid."$nextpagenum.html'>下一页</a>";
$endpage="<a href='list-".$gettypeid."$totalpage.html'>末页</a>";
}
else{
$endpage="末页";
}
//获得数字链接
$listdd="";
$total_list = $list_len * 2 + 1;
if($this->PageNo >= $total_list) {
$j = $this->PageNo-$list_len;
$total_list = $this->PageNo+$list_len;
if($total_list>$totalpage) $total_list=$totalpage;
}else{
$j=1;
if($total_list>$totalpage) $total_list=$totalpage;
}
for($j;$j<=$total_list;$j++){
$listdd.="<a href='list-".$gettypeid."$j.html'>".$j."</a>";
}
$plist .= $maininfo.$indexpage.$prepage.$listdd.$nextpage.$endpage;
return $plist;
}

打开inc_channel_unit_functions.php

查找
$reurl = $GLOBALS["cfg_plus_dir"]."/list.php?tid=".$typeid;

改成
//$reurl = $GLOBALS["cfg_plus_dir"]."/list.php?tid=".$typeid;
$reurl = "/list-".$typeid.".html";

增加.htaccess文件

内容为
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)list-([0-9]+)\.html$ $1/plus/list.php?tid=$2
RewriteRule ^(.*)list-([0-9]+)-([0-9]+)\.html$ $1/plus/list.php?typeid=$2&PageNo=$3
</IfModule>

 

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

织梦DEDECMS 栏目文章文章命名规则修改, 每次添加栏目的时候 都要改文章命名规则,十分麻烦, 修改下面这个地方就可以一改永亦,织梦模板网为您解答 找到\include\common.inc.php 搜索 $cfg_df_namerule 把: $cfg_df_namerule = {typedir}/{Y}/{M}{D}/{aid
很多人在修改织梦会员中心模板的时候 会遇到 明明修改了,为什么还是原来样式?确认文件没有修改错误的情况下,可能是缓存问题,你 只要把 /data/tplcache/ 里面的文件全部删除,重新访问即可。
dede织梦搜索伪静态,伪静态设置成功后,访问URL地址效果如下: 搜索页 http://www.baidu.com/search/织梦.html 搜索分页 http://www.baidu.com/search/织梦-2.html 本教程也适用于手机端。 开启伪静态: 后台-系统参数-核心设置-开启伪静态 后台-系统参数-
有时候我们需要实现织梦文章模型多个图片或者多个缩略图,这样的功能我们要怎么操作呢?其实方法还是蛮多的,不需要修改代码的办法就是在内容模型中建立多个字段(缺点就是想多加一个图就要多添加一个字段,而且上传也不方便,还有另外一种方法就是拓展类似
1、打开 /dede/spec_add.php 找到 $arcids = ; 改成 $arcids = array(); 2、打开 /dede/spec_edit.php 找到 $arcids = ; 改成 $arcids = array(); 完成
使用dedecms过程中,网站很容易被挂马,数据库也容易被刷爆,老是莫名其妙的多出了很多垃圾东西,大多都认为是3306这个端口号不太安全导致,想让小编给修改一下,修改了mysql的端口号,并重启了mysql服务,却发现dedecms无法连接数据库了,这是肯定的,因为