How to rewrite these

Glen Lumanau glen at
Sat Feb 20 18:45:19 MSK 2010

At last i found it.. what i need is just \d in front of the regex..

-----Original Message-----
From: Glen Lumanau [mailto:glen at] 
Sent: 20 Februari 2010 22:41
To: 'nginx at'
Subject: RE: How to rewrite these

I think i've confused :(

What i want is$number/title

i need to get that $number then rewrite it to$number

I've read about regex, and seems that's not the right thing to do

-----Original Message-----
From: Mauro Stettler [mailto:mauro.stettler at] 
Sent: 20 Februari 2010 21:46
To: nginx at
Subject: Re: How to rewrite these

honestly, i think you should really go through some regex tutorials

On Sat, Feb 20, 2010 at 22:42, Benjamin Pineau <ben at> wrote:
> Glen Lumanau a écrit :
>> Thank's for your prompt reply..
>> However i tried this
>> rewrite  "/news/([0-9] {2})([0-9] {2})([0-9] {2})/$"
>> but it doesn't work. What I've missed?
> The regexp pattern isn't correct. You shouldn't have spaces before
> the "{2}" unless you really want to match two consecutive spaces.
> Even without those spaces, this pattern would match urls like
> "/news/123456/" (without "/title" and with a trailing slash), while
> you said you need to match "/news/$id/title" instead. Also, if you
> want to fade out the old url in the long run, you could use a
> permanent redirect.
> You probably want something like that:
> rewrite ^/news/([0-9]{6})/title$
>$1 permanent;
> _______________________________________________
> nginx mailing list
> nginx at

nginx mailing list
nginx at

More information about the nginx mailing list