rewrite URI include "&" problem

lhmwzy lhmwzy at
Wed Feb 4 18:58:56 MSK 2009

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?

More information about the nginx mailing list