开发者

Regex extract number for RewriteRule

For http://macintosh.local/clientname/102

I can get the numeric reference (3 digits) like this:

开发者_JAVA技巧
RewriteRule ^[^/]+/([0-9]{3}+)/?$ album.php?ref=$1 [L]

Now I want to get my reference in my SEO URL:

http://macintosh.local/clientname/102-some-keywords


just replace /? with .*

RewriteRule ^[^/]+/([0-9]{3}+).*$ album.php?ref=$1 [L]


It looks like your existing regex should work just fine. It won't pick up non-numeric characters, after all.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜