mod_rewrite规则丢失了一个变量(regex问题)



我得到了以下mod_rewrite规则

Rewriterule ^products/([0-9]+)/([a-zA-Z0-9]+)[^a-zA-Z0-9]+([a-zA-Z0-9]+) /products/$2-$3-C$1 [R=301,L]

因此,当有这样的链接时:

http://www.domain.com/products/2930/Monet, Claude

它应该翻译成

http://www.domain.com/products/Monet-Claude-C2930

然而,它以某种方式摆脱了Claude,并将其翻译为:

http://www.domain.com/products/Monet-C2930

这不是很奇怪吗?它怎么了?

更新

我刚刚注意到问题是由上面的一条规则引起的:Rewriterule ^products/([0-9]+)/([a-zA-Z0-9]+) /products/$2-C$1 [R=301,L]和我忘记用$sign

结束它

it Is Must Be Work Test it

RewriteRule ^products/([0-9]*)/([a-zA-Z0-9]+)[^a-zA-Z0-9]+([a-zA-Z0-9]*)$  /products/$2-$3-C$1 [R=301,L]

最新更新