开发者

htaccess regex for number greater than 1?

I'm trying to create a rewrite rule to match data-2, data-3, data-4 etc. and send them to data.php?var=2. 开发者_运维问答It needs to ignore data-1.

RewriteRule ^data-([2-9])/?$ index.php?page=data&var=$1 [NC,L]

The above rule works for numbers 2-9, but how can I make it so that it works for any number greater than 1?


RewriteRule ^data-([2-9]|[1-9]\d+)/?$ index.php?page=data&var=$1 [NC,L]


Try:

RewriteRule ^data-([2-9]|[1-9]\d+)/?$ index.php?page=data&var=$1 [NC,L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜