Pretty URL on NGINX and queries in the URL not working
Posted: Fri Feb 24, 2023 12:20 pm
I'm sorry if I put this question in the wrong category, but I could not find another, more suitable category.
I have moved a CMSMS site from an apache server to a new server that runs NGINX. I set up the NGINX config to allow for pretty URLs as advised:
But one of the pages in this CMS uses queries in the URL to filter the content. Like https://domain.com/accesspage?foo=bar
This URL is not working on the NGINX server, but if I add an & in front of foo=bar, it works. https://domain.com/accesspage?&foo=bar
It's as if the URL is rewritten as https://domain.com/index.php?page=accesspage?foo=bar, and that, of course, does not work
Has anyone else run into this problem?
Is there a way to edit the try_files or to add a separate rewrite rule, to make this URL work as intended: https://domain.com/accesspage?foo=bar
I have moved a CMSMS site from an apache server to a new server that runs NGINX. I set up the NGINX config to allow for pretty URLs as advised:
Code: Select all
location / {
try_files $uri $uri/ /index.php?page=$request_uri;
}
This URL is not working on the NGINX server, but if I add an & in front of foo=bar, it works. https://domain.com/accesspage?&foo=bar
It's as if the URL is rewritten as https://domain.com/index.php?page=accesspage?foo=bar, and that, of course, does not work
Has anyone else run into this problem?
Is there a way to edit the try_files or to add a separate rewrite rule, to make this URL work as intended: https://domain.com/accesspage?foo=bar