无法在mod_rewrie中使用多个规则

时间:2009-07-28 10:53:19

标签: mod-rewrite

我需要用它吗

RewriteEngine On

RewriteCond%{SERVER_PORT}!^ 9090 $

RewriteRule ^ vendor /([0-9] +)。html $ productcategory.iface?Operation = category& catid = $ 1 [L,R]

RewriteRule ^ vendor /([0-9] +)([0-9] +)。html $ productcategory.iface?Operation = product& prodid = $ 2

RewriteRule ^ vendor /([0-9] +)([0-9] +)([0-9] +)。html $ productcategory.iface?Operation = vendet& prodid = $ 2& venid = $ 3

但我使用此规则我发现500错误是错误配置错误

1 个答案:

答案 0 :(得分:0)

不允许在指令内换行。所以试试这个:

RewriteEngine On
RewriteCond %{SERVER_PORT} !^9090$
RewriteRule ^vendor/([0-9]+)\.html$ productcategory.iface?Operation=category&catid=$1 [L,R]
RewriteRule ^vendor/([0-9]+)\([0-9]+)\.html$ productcategory.iface?Operation=product&prodid=$2
RewriteRule ^vendor/([0-9]+)\([0-9]+)\([0-9]+)\.html$ productcategory.iface?Operation=vendet&prodid=$2&venid=$3