nginx $_GET 取到两次值的问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/default7/article/details/84376549

nginx GET导致两次取值

测试

访问网址 /query?a[]=1&a[]=2,执行print_r($_GET),输出结果是有两个一样的取值

Array
(
    [a] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 1
            [3] => 2            
        )
)

解决

问题在于nginx配置

if (!-e $request_filename) {
	rewrite  ^(.*)$  /index.php?$args  last;
}

?$args 去掉重启,正常

猜你喜欢

转载自blog.csdn.net/default7/article/details/84376549
今日推荐