rewrite URI include "&" problem

Igor Sysoev is at rambler-co.ru
Wed Feb 4 19:20:31 MSK 2009


On Wed, Feb 04, 2009 at 11:58:56PM +0800, lhmwzy wrote:

> I have a rewirte rule:
>                 if (-f $request_filename ) {
>                         rewrite ^/(.*/)(.*)$
> /file.php?path=$1$2&filename=$2 last;
>                 }
> if a URI include "&",the file.php will not function normally.
> For example:
> request /1&2/test.txt
> the php file file.php will return "$path=1" and "$file=test.txt"
> the correct is "$path=1&2/test.txt" and "file=test.txt"
> 
> How to resolve this problem?

Currently no way.
nginx internally decodes %26 to "&" and does not escape captures.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list