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 |
上一篇: FTP上传出现Socket错误解决办法
下一篇: 三行判断是否为ip地址
目前这篇文章有2条评论(Rss)