JTBC(CMS)内容管理系统PHP版本的伪静态(开源与免费的网站内容管理系统)
[重要通告]如您遇疑难杂症,本站支持知识付费业务,扫右边二维码加博主微信,可节省您宝贵时间哦!
最近哥们要做一个帮助系统,看上了JTBC(CMS)内容管理系统,奈何不想用生成,对SEO或者美观度,还是显示为静态比较好,
那就是伪静态,他们家的东西也是真全乎,啥版本的都有 PHP NET JSP ASP 不得了,高端大气上档次;官方下载地址https://www.jtbc.cn/download/
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;
==============================================================================
以下是一个比较完整的的伪静态,也仅供参考
RewriteEngine on
RewriteRule ^news/index.html$ news/index.php
RewriteRule ^news/detail-(.[0-9]*).html$ news/index.php?type=detail&id=$1
RewriteRule ^news/list-(.[0-9]*)-(.[0-9]*).html$ news/index.php?type=list&classid=$1&offset=$2
RewriteRule ^case/index.html$ case/index.php
RewriteRule ^case/detail-(.[0-9]*).html$ case/index.php?type=detail&id=$1
RewriteRule ^case/list-(.[0-9]*)-(.[0-9]*).html$ case/index.php?type=list&classid=$1&offset=$2
RewriteRule ^index.html$ index.php
RewriteRule ^aboutus.html$ aboutus.php
RewriteRule ^web.html$ web.php
RewriteRule ^contact.html$ contact.php
RewriteRule ^net/detail-(.[0-9]*).html$ net/index.php?type=detail&id=$1
RewriteRule ^net/detail-(.[0-9]*)-(.[0-9]*).html$ net/index.php?type=list&classid=$1&offset=$2ErrorDocument 404 /404.html
RewriteEngine on
RewriteCond %{http_host} ^yihunweb.com [NC]
RewriteRule ^(.*)$ http://www.yihunweb.com/$1 [R=301,L]
news是文章模块,case产品模块,net是aboutus模块,下面4句是404和301重定向。
然后记得修改配置管理模块的链接模式然后删除缓存,基本上是没有问题的
===================================================================
还搜索到一名网友给出的伪静态方式,仅供参考
1.把ISAPI_Rewrite.dll和httpd.ini 传到空间根目录任意文件夹
2.在空间控制面板里面设置ISAPI筛选器.把ISAPI_Rewrite.dll添加进去(基本空间都有这功能吧)
3.到jtbc 要伪静态模块目录下config.jtbc里面.
<item>
<name><![CDATA[nurltype]]></name>
<chinese><![CDATA[0]]></chinese>
</item>
改成
<item>
<name><![CDATA[nurltype]]></name>
<chinese><![CDATA[3]]></chinese>
</item>
4.完成
下面是ISAPI_Rewrite伪静态规格 :
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
#表示将目录下Default.aspx映射为Default.htm
RewriteRule /articles/Default.htm /articles/Default\.aspx [N,I]
#文章内容连接
RewriteRule /articles/detail-(\d+)\.htm /articles/default\.aspx\?type=detail&id=$1 [N,I]
#文章内容翻页翻页连接
RewriteRule /articles/detail-(\d+)-(\d+)\.htm /articles/default\.aspx\?type=detail&id=$1&ctpage=$2 [N,I]
#二级菜单连接
RewriteRule /articles/list-(\d+)-(\d+)\.htm /articles/default\.aspx\?type=list&class=$1&page=$2 [N,I]
#数字翻页连接
RewriteRule /articles/list--(\d+)-(\d+)\.htm /articles/default\.aspx\?type=list&class=$1&page=$2 [N,I]
上面是把articles伪静态 其他要伪静态照葫芦画瓢
其他版本 方法一样 (asp.php.net.jsp)
===================================================================
问题未解决?付费解决问题加Q或微信 2589053300 (即Q号又微信号)右上方扫一扫可加博主微信
所写所说,是心之所感,思之所悟,行之所得;文当无敷衍,落笔求简洁。 以所舍,求所获;有所依,方所成!