【发布时间】:2011-02-13 07:10:59
【问题描述】:
我需要将 www.sample.com/user/john/ 重写为 www.sample.com/user/?u=john
此代码仅在我省略尾随/“www.sample.com/user/john”时才有效,我如何让它像“www.sample.com/user/john/”一样工作?
重写规则 ^([A-Za-z0-9_]+)$ index.cfm?u=$1 [L]
现在我需要它进一步发挥作用
www.sample.com/user/john/23564/ 改写为“www.sample.com/user/?u=john&i=23564”
即使没有/23564/,“www.sample.com/user/john”仍应使用单词
谢谢
【问题讨论】:
标签: regex .htaccess mod-rewrite rewrite