/common/incfiles/lib/jtbc/route.inc.php
查找$urltype = base::getNum(tpl::take(‘global.’ . $genre . ‘:config.urltype’, ‘cfg’), 0);
替换成$urltype = base::getNum(tpl::take(‘global.’ . $genre . ‘:config.urltype’, ‘cfg’), 1);

Apache Rewrite:
新建个记事本,内容如下,重命名为 .htaccess ,放到网站根目录下

RewriteRule ^aboutus/detail-(.[0-9]*).html$ aboutus/index.php?type=detail&id=$1
RewriteRule ^aboutus/detail-(.[0-9]*)-(.[0-9]*).html$ aboutus/index.php?type=detail&id=$1&page=$2

RewriteRule ^news/detail-(.[0-9]*).html$ news/index.php?type=detail&id=$1
RewriteRule ^news/detail-(.[0-9]*)-(.[0-9]*).html$ news/index.php?type=detail&id=$1&page=$2
RewriteRule ^news/list-(.[0-9]*).html$ news/index.php?type=list&category=$1
RewriteRule ^news/list-(.[0-9]*)-(.[0-9]*).html$ news/index.php?type=list&category=$1&page=$2

RewriteRule ^case/detail-(.[0-9]*).html$ case/index.php?type=detail&id=$1
RewriteRule ^case/detail-(.[0-9]*)-(.[0-9]*).html$ case/index.php?type=detail&id=$1&page=$2
RewriteRule ^case/list-(.[0-9]*).html$ case/index.php?type=list&category=$1
RewriteRule ^case/list-(.[0-9]*)-(.[0-9]*).html$ case/index.php?type=list&category=$1&page=$2

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nginx Rewrite:代码如下

rewrite ^/aboutus/detail-(.[0-9]*).html$ /aboutus/index.php?type=detail&id=$1;
rewrite ^/aboutus/detail-(.[0-9]*)-(.[0-9]*).html$ /aboutus/index.php?type=detail&id=$1&page=$2;

rewrite ^/news/detail-(.[0-9]*).html$ /news/index.php?type=detail&id=$1;
rewrite ^/news/detail-(.[0-9]*)-(.[0-9]*).html$ /news/index.php?type=detail&id=$1&page=$2;
rewrite ^/news/list-(.[0-9]*).html$ /news/index.php?type=list&category=$1;
rewrite ^/news/list-(.[0-9]*)-(.[0-9]*).html$ /news/index.php?type=list&category=$1&page=$2;

rewrite ^/case/detail-(.[0-9]*).html$ /case/index.php?type=detail&id=$1;
rewrite ^/case/detail-(.[0-9]*)-(.[0-9]*).html$ /case/index.php?type=detail&id=$1&page=$2;
rewrite ^/case/list-(.[0-9]*).html$ /case/index.php?type=list&category=$1;
rewrite ^/case/list-(.[0-9]*)-(.[0-9]*).html$ /case/index.php?type=list&category=$1&page=$2;

发表评论

共有 0 条评论