discuzX3.5和discuzX3.4的伪静态规则一样吗? New
在amh面板中,新建规则的时候,看到只有discuzX选项,默认是:rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;rewrite ^([^\.]*)/article-(+)-(+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;rewrite ^([^\.]*)/forum-(\w+)-(+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;rewrite ^([^\.]*)/thread-(+)-(+)-(+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;rewrite ^([^\.]*)/group-(+)-(+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;rewrite ^([^\.]*)/blog-(+)-(+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;rewrite ^([^\.]*)/(fid|tid)-(+)\.html$ $1/index.php?action=$2&value=$3 last;rewrite ^([^\.]*)/(+*)-(+)\.html$ $1/plugin.php?id=$2:$3 last;if (!-e $request_filename) { return 404;}
我知道答案 回答被采纳将会获得1 贡献 已有1人回答 完全一样 Discuz! X3.4 和 Discuz! X3.5 的伪静态规则基本上是相同的,因为这两个版本在伪静态处理方面没有进行大的改动。你提供的伪静态规则适用于 Discuz! X3.4 和 X3.5 版本。
以下是你在 AMH 面板中看到的默认伪静态规则,适用于 Discuz! X3.4 和 X3.5:
rewrite ^(*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
rewrite ^(*)/article-(+)-(+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
rewrite ^(*)/forum-(\w+)-(+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
rewrite ^(*)/thread-(+)-(+)-(+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
rewrite ^(*)/group-(+)-(+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
rewrite ^(*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
rewrite ^(*)/blog-(+)-(+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;
rewrite ^(*)/(fid|tid)-(+)\.html$ $1/index.php?action=$2&value=$3 last;
rewrite ^(*)/(+*)-(+)\.html$ $1/plugin.php?id=$2:$3 last;
if (!-e $request_filename) {
return 404;
}
这些规则涵盖了 Discuz! 的主要功能模块,包括门户、论坛、群组、用户空间、博客等。如果你在升级到 Discuz! X3.5 时没有对伪静态规则进行修改,这些规则仍然可以正常工作。
### 注意事项:
1. **Nginx 配置**:如果你使用的是 Nginx 服务器,确保这些规则被正确地放置在 Nginx 的配置文件中,并且服务器已经重新加载了配置。
2. **Apache 配置**:如果你使用的是 Apache 服务器,伪静态规则需要转换为 `.htaccess` 文件中的规则。
3. **伪静态设置**:在 Discuz! 后台,确保已经开启了伪静态功能,并且选择了正确的伪静态规则类型。
如果你在升级到 Discuz! X3.5 后遇到伪静态问题,可以检查以下几点:
- 确保服务器配置正确。
- 确保 Discuz! 后台的伪静态设置正确。
- 如果有自定义的伪静态规则,确保它们与默认规则兼容。
希望这些信息对你有所帮助!如果你有其他问题,欢迎继续提问。
-- 本回答由 人工智能 AI智能体 生成,内容仅供参考,请仔细甄别。
页:
[1]