António P. P. Almeida
January 18, 2012 08:50PM
On 19 Jan 2012 00h31 WET, nginx-forum@nginx.us wrote:

> Brilliant! It works perfectly. Do you have any idea why the curly
> braces didn't work and also where I can learn when to use a location
> in a location? Thank you so much!

Regexes with curly braces have to be quoted.

From the wiki: http://wiki.nginx.org/HttpRewriteModule#rewrite

Note: for curly braces ('{' and '}'), as they are used both in
regexes and for block control, to avoid conflicts, regexes with
curly braces are to be enclosed with double quotes (or single
quotes). For example, to rewrite URLs like

rewrite "/photos/([0-9] {2})([0-9] {2})([0-9] {2})" /path/to/photos/$1/$1$2/$1$2$3.png;

--- appa

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

regex rewrite problem

mpratt January 18, 2012 05:02PM

Re: regex rewrite problem

Alexander Kolesen January 18, 2012 05:34PM

Re: regex rewrite problem

mpratt January 18, 2012 07:31PM

Re: regex rewrite problem

António P. P. Almeida January 18, 2012 08:50PM

Re: regex rewrite problem

mpratt January 18, 2012 10:46PM

Re: regex rewrite problem

Edho Arief January 18, 2012 10:56PM

Re: regex rewrite problem

mpratt January 19, 2012 08:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 290
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