【发布时间】:2012-05-05 15:02:47
【问题描述】:
在我的 .htaccess 中,我做了一些 rewriteURL,但我在获取数据时遇到了一些问题。
我有:RewriteRule ^forum/([0-9]+)-([a-zA-Z]+)/([0-9]+)-([a-zA-Z]+)/?$ index.php?page=forum&category=$1&topic=$3 [NC,L]
所以我可以得到例如:index.php?page=forum&category=123&topic=456 这个URL forum/123-cat/456-topic
但我想要这个正则表达式 ^forum/([0-9]+)-([a-zA-Z]+)(/([0-9]+)-([a-zA-Z]+))?/?$,但 $3 得到 456-topic 而不仅仅是 456。
那么如何获得456?
谢谢>
【问题讨论】: