是否可以制定这样的规则:
example.com/param1val/param2val/param3val/...
如下,许多参数。我不知道它们中有多少会存在,但我想把它重写为:
... example.com/index.php?param1=param1val¶m2=param2val¶m3=param3val
等等。是否有可能在一条规则中?
答案 0 :(得分:0)
根据我的评论,这个答案适用于case 1)
:
RewriteEngine On
## reucrsion based rule to convert /user/n1/v1/n2/v2 to /user.php?n2=v2&n1=v1
RewriteRule ^(index\.php)/([^/]*)/([^/]*)(/.*)?$ /$1/$4?$2=$3 [L,QSA,NC]