3

I'm working on a php page which can't retrieve the GET parameter values from the browser url

ex- if i pass below url via browser

http://www.test.com/afvalbakken?price[]=&price[]=&17[]=&17[]=&16[]=107&18[]=180

the var_dump($_GET) the output below array.and it not shows the parameters passed

array(1) {
  ["url"]=>
  string(11) "afvalbakken"
}

i use a htaccess file for some url rewrite.below has its codes

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

anyone know how to access those get parameters please, thank you

anubhava
  • 761,203
  • 64
  • 569
  • 643
Salinda Bandara
  • 203
  • 7
  • 20

1 Answers1

3

You need QSA flag here:

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

QSA (Query String Append) flag preserves existing query parameters when you are adding a new one.

anubhava
  • 761,203
  • 64
  • 569
  • 643