正则式 url rewrite 急!!!
014zx 2008-04-10 11:47:33 RewriteRule ^/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)\.html /index.php\?controller=$1&action=$2&$3=$4&$5=$6&$7=$8
按以上规则
http://www.xxx.com/user/show/name/tom/sex/1/age/25.html
可以解释为
http://www.xxx.com/index.php?controller=user&action=show&name=tom&sex=1&age=25
由于需要还要加一个参数,希望达到以下效果
http://www.xxx.com/user/show/name/tom/sex/1/age/25/from/china.html
解释为
http://www.xxx.com/index.php?controller=user&action=show&name=tom&sex=1&age=25&from=china
规则添加如下
RewriteRule ^/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)\.html /index.php\?controller=$1&action=$2&$3=$4&$5=$6&$7=$8&$9=$10
按以上规则
http://www.xxx.com/user/show/name/tom/sex/1/age/25/from/china.html
却解释为
http://www.xxx.com/index.php?controller=user&action=show&name=tom&sex=1&age=25&from=user0
也就是正则式里的$10被看做是$1加上'0'的字符串了,而不是想要的第十个参数
请教$10该怎么改写?