mod 重写导致 SMF 论坛中漂亮的 url 出现错误

发布于 2024-08-07 23:14:51 字数 564 浏览 7 评论 0原文

我安装了一个 mod(漂亮的 url)来重写此 SMF 论坛的 url,它适用于除此之外的所有板:

http://mmaturf.com/forum/genghis- con's-turf/

我相信这与撇号有关,但我的 mod 重写能力可以忽略不计。

创建的规则如下所示:

# Rules for: boards
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]

任何帮助将不胜感激!

I installed a mod (pretty urls) to rewrite the urls of this SMF forum and it works for all the boards except this one:

http://mmaturf.com/forum/genghis-con's-turf/

I believe it has to do with apostrophe, but my mod rewrite skills are negligible.

The rule that was created looks like this:

# Rules for: boards
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]

Any assistance would be appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乄_柒ぐ汐 2024-08-14 23:14:51

这个问题仍然没有答案。

正则表达式中的撇号表示表达式可以包含撇号符号。

问题出在MOD本身。导航到 SMF 源中的 Subs-PrettyUrl.php 并查找。

''=>数组 ('?', '?', '?', '?', '?', '«', '»', ':', '&', '+', '@', '%' , '^', '?', '#'),

在数组中添加您希望 URL 忽略的任何符号。

This question is still unanswered.

The apostrophe in the Regexp means the expression can contain the apostrophe symbol.

The problem lies in the MOD itself. Navigate to Subs-PrettyUrl.php in the Sources of SMF and find.

'' => array ('?', '?', '?', '?', '?', '«', '»', ':', '&', '+', '@', '%', '^', '?', '#'),

The add any symbol you want the URL to ignore in the array.

晚雾 2024-08-14 23:14:51

尝试转义规则中的撇号,即

RewriteRule ^([-_!~*\'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*\'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]

Try escaping the apostrophe in the rule, i.e.

RewriteRule ^([-_!~*\'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*\'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文