I am using the following to redirect all request to index.php
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
This works on the following:
example.com/foo
example.com/foo/bar/et
but it doesn't work on:
example.com/foo?bar
example.com/foo?bar=quz
To summarize what I need, the following:
example.com/foo
example.com/foo/bar/etc
example.com/foo?bar
example.com/foo?bar=quz
should all serve index.php "silently" without changing the URL of the browser's address bar.
Additionally, when calling:
example.com/foo?bar=quz
PHP's $_GET variable should have bar => quz as the value.
Anybody knows how to make this work in the rewrite rule?