craft.request.getQuery returns empty on multi lingual site I have the strangest bug. I have a site with two languages, Norwegian and English. In my code i check for craft.request.getQuery('prodid'). Locally in Apache this works fine with both language URLs, but in production on Nginx, it only works on the Norwegian version (the main language).

The URLS looks like this


http://onepark.no/leie-parkering/paleet?prodid=1
http://onepark.no/en/rent-parking/paleet?prodid=1


For the english URL (the second) craft.request.getQuery('prodid') returns an empty string. For the Norwegian URL it returns "1".

Nginx rewrite code:

location / {
    try_files $uri $uri/ @rewrites;
  }

location /en/ {
   try_files $uri $uri/ @enrewrites;
  }

location @enrewrites {
    rewrite ^/en/(.*)$ /en/index.php?p=$1? last;
  }

location @rewrites {
rewrite ^(.*) /index.php?p=$1 last;
}
Turns out the problem was with the Nginx config as Brad suggested. There was a question mark behind the p=$1. When we removed the ? and restarted PHP it worked.

location / {
    try_files $uri $uri/ @rewrites;
  }

location /en/ {
   try_files $uri $uri/ @enrewrites;
  }

location @enrewrites {
    rewrite ^/en/(.*)$ /en/index.php?p=$1 last;
  }

location @rewrites {
rewrite ^(.*) /index.php?p=$1 last;
}