伪静态传递多个不确定参数urlrewrite中怎么写?
何文琳 2011-11-22 05:39:21 比如现在的访问的地址是 http://house.o.cn/search_hT1_rTALL_atrue.htm 转向的地址是http://house.o.cn/rent/search.shtml?houseType=1&rentType=ALL&agency=true,并且链接http://house.o.cn/rent/search.shtml?houseType=1&rentType=ALL&agency=true的参数和个数都不固定,链接可能是http://house.o.cn/rent/search.shtml?houseType=1或http://house.o.cn/rent/search.shtml?houseType=1&rentType=ALL 三个参全有时我的写法是
<rule>
<from>^/rent/search_hT([A-Za-z0-9]*)_rT([A-Za-z0-9]*)_a([A-Za-z0-9]*).htm$</from>
<to>/rent/search.shtml?houseType=$1&rentType=$2&agency=$3</to>
</rule>
虽然可以把几种可能性都写出来,但是参数最多有19个,一个个写的话一个链接就要写几百个
<rule>
<from></from>
<to></to>
</rule>
这是最笨的方法,很不现实,因为写不全,会漏掉。所以,请问一下各位高手有没法子写个不管多少个参都通用的?谢谢各位了