杰奇 cms2.4 PC 跳移动识别跳转 js 跳转规则附带伪静态的设置

2023-08-27 8988阅读 0评论
首页 » 资源 » 技术 » 正文

杰奇 cms2.4 PC 跳移动识别跳转 js 跳转规则附带伪静态的设置

本文于 2020-12-28 14:44 更新,部分内容具有时效性,如有失效,请留言

相对于二次开发那些,这个确实是算简单的了,只需要根据网上的 js 自己补充而已,但是相对于每个模板都配置一条跳转规则,我还是有个简单的办法,不过还是得配合已经设置好的伪静态。在这篇教程里,小编就简单说明一下电脑和手机端两边的配置

杰奇 cms2.4 PC 跳移动识别跳转 js 跳转规则附带伪静态的设置 第1张

比较重要的页面主要是首页,书库,分类,小说信息,充值,目录,小说阅读,但是一般来说目录和小说阅读的头部是放置在单个文件中,不和其它页面共用。

假如:

电脑端网址为:pc.xx.com

手机端网址为:wap.xx.com

教程开始

首先是 PC 端的修改

1.在 PC 端的/themes/目录中找到当前设置的模板,进入后找到 theme.html,在它的 head 标签对中加入如下代码:

2.目录页和章节页头部可能在 themer.html,也可能是/modules/article/templates/里面的 style.html 和 index.html,同样是在 head 标签对加入如下代码。

然后是 WAP 端的修改:

1.在 WAP 端的/themes/目录中找到当前设置的模板,进入后找到 theme.html,在它的 head 标签对中加入如下代码:

2.目录页和章节页和 pc 差不多相同,一样的逻辑,就是目录页面的细节不一样。

杰奇后台伪静态的设置,没写的自己按照格式写伪静态规则,或者不填。

小说信息页面伪静态规则:/book/

小说分类页面伪静态规则:/sort//.html

排行榜页面伪静态规则:/top//.html

书库伪静态规则:/book__________.html

小说目录页伪静态规则:/index/

小说章节页伪静态规则:/book//.html

搜索结果页伪静态规则:/search///.html

搜索结果页伪静态规则:/reviews//.html

标签列表页伪静态规则:/taglist//.html

apache 伪静态,在根目录创建.htaccess

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^templates/(.*).html$ /404.php

RewriteRule ^themes/(.*)/(.*).html$ /404.php

RewriteRule ^modules/(.*)/templates/$ /404.php

RewriteRule ^modules/(.*)/templates/(.*).html$ /404.php

RewriteRule ^book/([0-9]+)$ /modules/article/articleinfo.php?id=$1

RewriteRule ^index/([0-9]+)$ /modules/article/reader.php?aid=$1

RewriteRule ^book/([0-9]+)/([0-9]+).html$ /modules/article/reader.php?aid=$1&cid=$2

RewriteRule ^vip/([a-zA-Z0-9]+)/([0-9]+).html$ /modules/obook/reader.php?aid=$1&cid=$2

RewriteRule ^sort/([0-9]+)/([0-9]+).html$ /modules/article/articlelist.php?sortid=$1&page=$1

RewriteRule ^buyvip/([0-9]+).html$ /modules/obook/buychapter.php?cid=$1

RewriteRule ^books$ /modules/article/articlefilter.php

RewriteRule ^top/([a-z]+)/([0-9]+).html$ /modules/article/toplist.php?order=$1&page=$2

RewriteRule ^search/([0-9]+)/(.*)/([0-9]+).html$ /modules/article/search.php?searchtype=$1&searchkey=$2&page=$3

RewriteRule ^taglist/([0-9]+)/(.*).html$  /modules/article/taglist.php?sort=$1&page=$2

RewriteRule ^book_([a-z]+)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_([a-zA-Z0-9]+)_([0-9]+)_([0-9]+)_([0-9]+).html$ /modules/article/articlefilter.php?order=$1&rgroup=$2&sortid=$3&typeid=$4&words=$5&update=$6&initial=$7&isfull=$8&isvip=$9&page=$10

 

nginx 伪静态,需要自己填入配置文件:

if (!-d $request_filename){

set $rule_0 1$rule_0;

}

if (!-f $request_filename){

set $rule_0 2$rule_0;

}

if ($rule_0 = “21”){

rewrite ^/templates/(.*).html$ /404.php;

}

rewrite ^/themes/(.*)/(.*).html$ /404.php;

rewrite ^/modules/(.*)/templates/$ /404.php;

rewrite ^/modules/(.*)/templates/(.*).html$ /404.php;

rewrite ^/book/([0-9]+)$ /modules/article/articleinfo.php?id=$1;

rewrite ^/index/([0-9]+)$ /modules/article/reader.php?aid=$1;

rewrite ^/book/([0-9]+)/([0-9]+).html$ /modules/article/reader.php?aid=$1&cid=$2;

rewrite ^/vip/([a-zA-Z0-9]+)/([0-9]+).html$ /modules/obook/reader.php?aid=$1&cid=$2;

rewrite ^/sort/([0-9]+)/([0-9]+).html$ /modules/article/articlelist.php?sortid=$1&page=$1;

rewrite ^/buyvip/([0-9]+).html$ /modules/obook/buychapter.php?cid=$1;

rewrite ^/books$ /modules/article/articlefilter.php;

rewrite ^/top/([a-z]+)/([0-9]+).html$ /modules/article/toplist.php?order=$1&page=$2;

rewrite ^/search/([0-9]+)/(.*)/([0-9]+).html$ /modules/article/search.php?searchtype=$1&searchkey=$2&page=$3;

rewrite ^/taglist/([0-9]+)/(.*).html$ /;

rewrite ^/book_([a-z]+)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_([a-zA-Z0-9]+)_([0-9]+)_([0-9]+)_([0-9]+).html$ /modules/article/articlefilter.php?order=$1&rgroup=$2&sortid=$3&typeid=$4&words=$5&update=$6&initial=$7&isfull=$8&isvip=$9&page=$10;

 

2019/06/13 补充:

杰奇 2.4的 wap 端目录采用的是分页模式,并且还拥有正序倒序的功能,所以如果按照电脑的写法,将会导致无法翻页,正确的配置文件应该是将目录页的伪静态改为如下。

‘fakearticle’ => ‘/index///’,

 

nginx 的目录伪静态改为:

rewrite ^/index/([0-9]+)/([0-9]+)/([a-z]+)$ /modules/article/reader.php?aid=$1&page=$2&order=$3;

 

apache 的目录伪静态改为:

RewriteRule ^index/([0-9]+)/([0-9]+)/([a-z]+)$ /modules/article/reader.php?aid=$1&page=$2&order=$3;


免责声明
1、本网站属于个人的非赢利性网站,转载的文章遵循原作者的版权声明。
2、本网站转载文章仅为传播更多信息之目的,凡在本网站出现的信息,均仅供参考。本网站将尽力确保所
提供信息的准确性及可靠性,但不保证信息的正确性和完整性,且不对因信息的不正确或遗漏导致的任何
损失或损害承担责任。
3、任何透过本网站网页而链接及得到的资讯、产品及服务,本网站概不负责,亦不负任何法律责任。
4、本网站所刊发、转载的文章,其版权均归原作者所有,如其他媒体、网站或个人从本网下载使用,请在
转载有关文章时务必尊重该文章的著作权,保留本网注明的“稿件来源”,并白负版权等法律责任。

手机扫描二维码访问

文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

发表评论

快捷回复: 表情:
评论列表 (暂无评论,8988人围观)

还没有评论,来说两句吧...

目录[+]