RewriteRule 中的正则表达式在 MAMP 中中断

发布于 2024-10-03 22:29:01 字数 485 浏览 0 评论 0原文

我刚刚从 XAMPP 切换到 MAMP,现在这个重写规则不再起作用

RewriteRule ^([0-9]{6}+)/?$ includes/redirect.php?ref=$1 [L]

在 Appache 错误日志中:

[Mon Nov 22 13:59:24 2010] [alert] [client 172.xx.xx.x] /Applications/MAMP/htdocs/myapp/.htaccess: RewriteRule: cannot compile regular expression '^([0-9]{6}+)/?$'

有什么想法吗?我的其他规则(来自redirect.php)工作正常:

RewriteRule ^([0-9]{6})-.*?\.html$ templates/default/index.php?ref=$1 [L]

I just switched from XAMPP to MAMP and now this rewrite rule does not work anymore

RewriteRule ^([0-9]{6}+)/?$ includes/redirect.php?ref=$1 [L]

In the Appache error log:

[Mon Nov 22 13:59:24 2010] [alert] [client 172.xx.xx.x] /Applications/MAMP/htdocs/myapp/.htaccess: RewriteRule: cannot compile regular expression '^([0-9]{6}+)/?

Any idea's? My other rule (from redirect.php) works fine:

RewriteRule ^([0-9]{6})-.*?\.html$ templates/default/index.php?ref=$1 [L]

Any idea's? My other rule (from redirect.php) works fine:

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

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

发布评论

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

评论(1

池予 2024-10-10 22:29:01
 [0-9]{6}+

这是一个奇怪的片段,我怀疑这就是问题所在。您说的是 6 位数字,然后又说一位或多位数字?

您想要匹配什么?

 [0-9]{6}+

This is an odd fragment that I suspect is the issue. You're saying exactly 6 digits, then saying one-or-more as well?

What did you want to be matched?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文