That’s awkward. I wish PHP CMSes would start actually doing their own routing via the index.php
like all other modern PHP frameworks do. Sigh.
But in this case, I think try_files
alone won’t be enough for you, you’ll need to use the path_regexp
matcher to grab just the part after the slash, and the file
matcher to skip doing the rewrite if the request is for a static file.
@page {
path_regexp page ^/(.+)$
not file {path} {path}/
}
rewrite @page /index.php?{re.page.1}&{query}