Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
GET参数无法使用php检索_Php_.htaccess_Mod Rewrite_Url Rewriting_Get - Fatal编程技术网

GET参数无法使用php检索

GET参数无法使用php检索,php,.htaccess,mod-rewrite,url-rewriting,get,Php,.htaccess,Mod Rewrite,Url Rewriting,Get,我正在处理一个无法从浏览器url检索GET参数值的php页面 例如,如果我通过浏览器传递下面的url http://www.test.com/afvalbakken?price[]=&price[]=&17[]=&17[]=&16[]=107&18[]=180 var_dump($_GET)在数组下面显示输出。它不显示传递的参数 array(1) { ["url"]=> string(11) "afvalbakken" } 我使用htac

我正在处理一个无法从浏览器url检索GET参数值的php页面

例如,如果我通过浏览器传递下面的url

http://www.test.com/afvalbakken?price[]=&price[]=&17[]=&17[]=&16[]=107&18[]=180
var_dump($_GET)在数组下面显示输出。它不显示传递的参数

array(1) {
  ["url"]=>
  string(11) "afvalbakken"
}
我使用htaccess文件进行url重写。下面有它的代码

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?url=$1 [L]

任何人都知道如何访问这些get参数,谢谢您

您需要
QSA
标志:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?url=$1 [L,QSA]

QSA
(查询字符串附加)标志在添加新的查询参数时保留现有的查询参数。

太好了,这似乎可以正常工作,这会对网站当前的url重写系统产生影响,谢谢它不会影响任何重写。