在MAMP中RewriteRule中的正则表达式

时间:2010-11-22 13:12:41

标签: regex mod-rewrite mamp

我刚从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]

1 个答案:

答案 0 :(得分:0)

 [0-9]{6}+

这是一个奇怪的片段,我怀疑是这个问题。你说的只是6位数,然后说一个或多个?

你想要匹配什么?