I’m trying to mash together two PHP frameworks into a single installation. One is our old site, which has a ton of code… and one is new, which is an entirely separate codebase. Both process requests dynamically.
What I’d like to do is something like this:
try_files framework1.php?$uri framework2.php?$uri
So the first framework processes the request and if it returns a 404 error, it should attempt framework2.php
Is that possible? Is there any way for Nginx to intercept a 404 request (or any, for that matter) and attempt the next location?
If not – any workarounds?
Obvious solution is to catch all 404 errors and handle them to second framework:
But it’s causes problem with real 404 pages, so you have to return real 404 with framework itself if there is real 404 error.