【发布时间】:2013-12-05 15:55:25
【问题描述】:
我有一些请求参数,我将它们转换为友好的 URL
例如:
http://domain.com/members/girls/sort/last_reg/nick/ted/from/18/to/28/hfrom/150/hto/190/bbody/Athletic/
参数是动态的,所以 URL 可以是
http://domain.com/members/girls/nick/ted/from/18/to/28/hfrom/150/hto/190/bbody/Athletic/
或
http://domain.com/members/men/nick/ted/to/28/hfrom/150/hto/190/bbody/Athletic/
参数成对
parameter_name/parameter_value
唯一不变的是
http://domain.com/members/
如何将此 URL 转换为
http://domain.com/filename.php?sex=men&pram1=value1¶m2=value2 ......
或
http://domain.com/filename.php?sex=girls&pram1=value1¶m2=value2 ......
【问题讨论】:
标签: php regex apache .htaccess mod-rewrite