【发布时间】:2013-12-02 19:28:59
【问题描述】:
A 有 url 重写的问题。 我有这个网址:
http://www.example.com/apps/1-health-directory
有了这条规则:
RewriteRule ^apps/([^_]*)-([^_]*)$ /app_details.php?id=$1&name=$2 [L,QSA,NC]
问题是当我想获取 id 和 name 参数时,返回的是这个:
app_details.phpid=1-health&name=directory
正确的应该是
app_details.phpid=1&name=health-directory
怎么做?
谢谢
【问题讨论】:
标签: php regex apache .htaccess mod-rewrite