Welcome! Log In Create A New Profile

Advanced

RE: How to rewrite these

Glen Lumanau
February 20, 2010 11:36AM
It means that if I have 6 digits of numbers, it will redirect to the url
i've described

But if I have 5 digits of numbers, it's not redirecting to the URL.


-----Original Message-----
From: Benjamin Pineau [mailto:ben@zouh.org]
Sent: 20 Februari 2010 21:43
To: nginx@nginx.org
Subject: Re: How to rewrite these

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})/$"
> http://app.mydomain.com/redirect/application/$1$2$3;
>
> 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$
http://app.mydomain.com/redirect/application/$1 permanent;

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

Igor Sysoev February 20, 2010 11:36AM

Re: How to rewrite these

Igor Sysoev February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

Igor Sysoev February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

edogawaconan February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

edogawaconan February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

replay February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

Benjamin Pineau February 20, 2010 11:36AM

Re: How to rewrite these

replay February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

Benjamin Pineau February 20, 2010 12:04PM

Re: How to rewrite these

replay February 20, 2010 12:04PM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

Igor Sysoev February 20, 2010 11:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 153
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready