I am working on migrating a legacy API codebase to Slim. I would like to preserve backwards compatibility with the old routes by doing nginx rewrites of the old route names to the new Slim routes.
Is it possible to do a rewrite to a specific route? I have not been able to accomplish this. For example, if all of the new routes are prefixed with /api/, I would like to do something like the following in my nginx configuration file:
rewrite ^oldRouteName$ /api/newRouteName
When I try the above rewrite, my requests hit my Slim instance, but not the specific route that I want, although /api/newRouteName exists and handles direct requests properly. I always hit my Slim 404 Not Found handler with the above configuration.