首页 » 默认不分类 » dedecms伪静态设置方法

dedecms伪静态设置方法

先在DEDECMS后台开始伪静态,这时前台的文章链接会变成html结尾的
接下来在主机上设置规则分两种情况,详见正文。
如果没问题你会发现前台html可以打开了,如果要让列表栏目页也静态则要改下程序
打开include\channelunit.func.php
$reurl = $GLOBALS['cfg_phpurl'].”/list.php?tid=”.$typeid;
替换为
$reurl = $GLOBALS['cfg_phpurl'].”/list-”.$typeid.”.html”;

对于Linux主机,编辑根目录下的.htaccess文件加入下面代码

1
2
3
4
5
6
7
8
9
<IfModule mod_rewrite.c>
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
</IfModule>

对于Windows的主机,编辑php.ini文件加入下面代码

1
2
3
4
5
6
7
8
[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

,

转发到新浪微博 转发到新浪微博

目前这篇文章有2条评论(Rss)

  1. alberghi valmontone | #1
    05/16/2012 at 11:33

    Just want to say your article is as astounding. The clearness in your post is simply spectacular and i can assume you’re an expert on this subject. Well with your permission let me to grab your feed to keep up to date with forthcoming post. Thanks a million and please continue the rewarding work.

  2. http://www.gpsmoto.org/ | #2
    05/16/2012 at 12:56

    Only wanna state that this is very beneficial , Thanks for taking your time to write this. “Hollywood is a place where people from Iowa mistake each other for stars.” by Fred Allen.

我要评论