用户信息
帖子内容
1 楼
weeya
钻石会员
积分 1066
注册 2010-10-28
     
3.0.1.6版本设置伪静态及htaccess代码
/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;
本帖由 weeya 于 2018-09-24 01:27:35 编辑过
2018-09-24 00:22:26 东莞网站建设 http://www.yiisu.com/
2 楼
weeya
钻石会员
积分 1066
注册 2010-10-28
     
回复: 3.0.1.6版本伪静态步骤及htaccess代码
感谢荣轩!
2018-09-24 00:24:19 东莞网站建设 http://www.yiisu.com/
3 楼
shadoweb
钻石会员
积分 888
注册 2014-11-27
     
回复: 3.0.1.6版本设置伪静态及htaccess代码
好帖
2018-09-26 17:15:30 JTBC教程网 https://jtbc.com.cn/ 欢迎投稿