侠外游戏论坛

标题: discuz门户列表分页伪静态设置教程 [打印本页]

作者: 匿名    时间: 2022-11-12 03:54
标题: discuz门户列表分页伪静态设置教程
DISCUZ门户栏目列表分页URL默认是index.php?page=动态的URL地址,如何修改成伪静态呢?下面保哥教你方法:
编辑器打开source/module/portal/portal_list.php
找到下面这行代码:
$multi =multi($count, $perpage, $page, $cat['caturl'], $cat['maxpages']);
替换成如下代码:
$multi = str_replace("index.php?page=","page-",multi($count, $perpage, $page, $cat['caturl'], $cat['maxpages']));
然后在你的伪静态规则中添加以下规则:
RewriteRule ^(.*)/page-([0-9]+)(\?(.*))*$ $1/index.php?page=$2;
以上是apache的规则,以下是nginx的规则:
rewrite ^([^\.]*)/page-([0-9]+)(\?(.*))*$ $1/index.php?page=$2;





欢迎光临 侠外游戏论坛 (https://bbs.xiawai.com/) Powered by Discuz! X3