0

是否可以制定这样的规则:

example.com/param1val/param2val/param3val/...

如下,许多参数。我不知道其中有多少,但我想将其重写为:

example.com/index.php?param1=param1val¶m2=param2val¶m3=param3val...

等等。是否有可能在一个规则中?

4

1 回答 1

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]
于 2013-11-01T22:33:08.007 回答