Rewrite URI include "&" problem


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?



and if you correctly encode the “&”, it doesn’t work ? (function
rawurlencode() in PHP)

lhmwzy a écrit :


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

How to resolve this problem?

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