-2

在 ISAPI_rewrite 3 文档中是这个例子

RewriteRule ^(.*?\.asp)/([^/]*)/([^/]*)(/.+)? $1$4?$2=$3 [NC,LP,QSA]

http://www.example.com/foo.asp/a/A/b/B/c/C
http://www.example.org/foo.asp?a=A&b=B&c=C

由于我的产品在查询字符串中可以有或多或少的参数,这似乎是正确的方法。基于给定的示例,我尝试为我的案例创建一个规则,但没有成功。

http://www.example.com/product-name.aspx/a/A/b/B/c/C
http://www.example.org/products.aspx?a=A&b=B&c=C
4

1 回答 1

1

After more digging I came up with solution. Seems like there is no other way but using two rules.

  RewriteRule ^(.*?\.htm)/([^/]*)/([^/]*)(.+)? $1$4?$2=$3 [NC,LP,QSA]
  RewriteRule ^.*?\.htm$ product.aspx [NC,L]
于 2009-09-23T10:22:32.923 回答