Currently I have this piece of code:
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
This works OK for the following:
example.com/foo redirects to index.php
However example.com/foo?bar doesn’t work. How do you make it work?
FWIW: I don’t experience this problem in Apache’s mod_rewrite equivalent. Basically, I moved a site that works from Apache to Nginx. Now I experience this issue.
Edit:
To be clear here’s what I indent to do:
example.com/fooexample.com/foo/bar/etcexample.com/foo?barexample.com/foo?bar=quz
Should all serve index.php “silently” without changing the URL of the browser’s address bar.
I just tested it with the following config, and I believe this does want you want: