杰奇2.4的解密版这几天一直在测试,问题蛮多的,但是大多数都不影响使用,至从上篇文章采集问题解决之后,感觉博客交流群里很多人都玩了起来。那么,其实还是有个待解决问题的,就是伪静态的设置,从之前的版本都可以看出来,杰奇的伪静态复杂度比一般的程序高很多,但是其实掌握了规律,配置是非常简单的。
以下是我在制作模板时候,顺便弄好的配置,可以使用,但是希望也可以自己修改扩展。
timg (1).jpg
我只写了满足基本要求的部分,剩下的照格式来写就行,当做学习吧。

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

小说信息页面伪静态规则:/book/<{$id}>
小说分类页面伪静态规则:/sort/<{$sortid}>/<{$page}>.html
排行榜页面伪静态规则:/top/<{$order}>/<{$page}>.html
书库伪静态规则:/book_<{$order}>_<{$rgroup}>_<{$sortid}>_<{$typeid}>_<{$words}>_<{$update}>_<{$initial}>_<{$isfull}>_<{$isvip}>_<{$page}>.html
小说目录页伪静态规则:/index/<{$aid}>
小说章节页伪静态规则:/book/<{$aid}>/<{$cid}>.html
搜索结果页伪静态规则:/search/<{$searchtype}>/<{$searchkey}>/<{$page}>.html
搜索结果页伪静态规则:/reviews/<{$aid}>/<{$page}>.html
标签列表页伪静态规则:/taglist/<{$sort}>/<{$page}>.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=$2
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=$2;
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/<{$aid}>/<{$page}>/<{$order}>',

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;

相关文件下载(伪静态文件等)

什么都没有,自己看文章学习
万水千山总是情,给个打赏行不行。 打赏
本文来自投稿,不代表本站立场,如若转载,请注明出处:https://www.ruletree.club/archives/1245/