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
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;
}