14时59分 03月16日 2010年

DedeCMS 5.5 栏目页伪静态的修改方法

Category: CSS, Author: Shenai Qiu, Popularity: 25%

  自制的 DedeCMS 网站模版快完成了,幻灯片代码修改是花了RMB才搞掂的,现在需要的就是完善细节。我不是很喜欢 DedeCMS 栏目页动态表示方式,使用静态又不能即时更新,最好的解决办法就是将栏目页设置为伪静态。试了DedeCMS 官方论坛的几个方法都不是很成功,主要是自己看不懂,哈哈!水平有限!

  以下的修改方法是在官方论坛收集到的,在本地测试成功,所以分享一下。

  1、服务器必须支持URL重写。
  2、后台开启伪静态。
  3、栏目设置使用动态。
  4、需要修改php文件include/channelunit.func.php
  
  查找:

$reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;

  修改为:

$reurl = $GLOBALS['cfg_phpurl']."/list-".$typeid.".html";

  linux主机系统,需要在根目录下新建或修改.htaccess文件(需要虚拟主机支持)。
  添加如下代码:

RewriteEngine On
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
 
RewriteRule index\.html /index\.php
RewriteRule plus/list-([0-9]+)\.html$ /plus/list.php?tid=$1
RewriteRule plus/view-([0-9]+)-([0-9]+)\.html$ /plus/view.php?arcID=$1&pageno=$3
RewriteRule plus/list-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3

  Winodws主机系统,需要在根目录下新建或修改httpd.ini文件(需要虚拟主机支持)。
添加如下代码:

[ISAPI_Rewrite]
 
# 缓存3600秒 = 1 小时(hour)
CacheClockRate 3600
 
RepeatLimit 32
 
RewriteRule ^(.*)/index\.html $1/index\.php
RewriteRule ^(.*)/plus/list-([0-9]+)\.html $1/plus/list\.php\?tid=$2
RewriteRule ^(.*)/plus/list-([0-9]+)-([0-9]+)-([0-9]+)\.html $1/plus/list\.php\?tid=$2&TotalResult=$3&PageNo=$4
RewriteRule ^(.*)/plus/view-([0-9]+)-([0-9]+)\.html $1/plus/view\.php\?arcID=$2&pageno=$3

Tags:, .
评论数量(0) | Add Comments
本文网址:http://www.shenaiqiu.com/archives/css/1035.html

There are No comments.

» You can leave a response or Trackback .

leave a reply