Welcome! Log In Create A New Profile

Advanced

rewrite location in the middle of the path

November 30, 2012 11:06AM
Здравствуйте!

Столкнулась с задачей: необходимо преобразовать url типа
/my-context/id/param1,param2,paramN в url типа
/dev/folder/id_param1,param2,paramN. Id может быть только числом.
Попробовала написать rewrite для данного преобразования.
location /my-context/([0-9]+)/(.*)$ {
rewrite /dev/folder/$1_$2/ permanent;
}
Итоговую строку получила в виде /dev/folder/id/param1,... etc.
В чем может быть проблема с заменой символов "/" на "_" ?

Спасибо!
Subject Author Posted

rewrite location in the middle of the path

nrsk November 30, 2012 11:06AM

Re: rewrite location in the middle of the path

Peter Vereshagin November 30, 2012 11:44AM

Re: rewrite location in the middle of the path

Maxim Dounin November 30, 2012 12:16PM

Re: rewrite location in the middle of the path

nrsk November 30, 2012 02:55PM

Re: rewrite location in the middle of the path

Peter Vereshagin December 01, 2012 03:30PM

Re: rewrite location in the middle of the path

nrsk December 03, 2012 02:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 220
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready