I'm having a bit of an issue with module routes, essentially the issue is this.
I have an application with but nothing in it essentially, all code is in two modules. I'm using these as a way to separate code, these two modules are essentially frontend and admin code.
So anyway in my application I have the following routes...
/app/config/routes.php
==============
root => /frontend/content/home
error => /frontend/mycontroller/error
I also have several other routes in my frontend module, but these don't appear to work. For instance I have a route in: /app/modules/frontend/config/routes.php
about => content/pages/about
But it doesn't work when I go to /about on my application, it does work if I go to /frontend/about. I've tried adding (:any) => /frontend/$1 but this doesn't work, can anyone tell me how to get a setup like this working? It looks as if my route /frontend/$1 works if I have a controller for this, e.g. if I had a controller called "about" but this isn't what I wanted, I was hoping that this would route to /frontend/about and this would be dealt with by the routes in my /frontend module.
No, then it will indeed not work, because routes are not processed recursively.
Which in your case will be solved by a second Request, which will process the routes again. It just comes across as quite heavy, basically doubling the amount of requests your server has to process.
Perhaps it's an option to put a bit more intelligence in the routing system?
In your app/config/routes.php, call a static class method that loads the routes.php from your module (or modules), merge them, and return them instead of the static array?
Or alternatively, inject routes directly, using \Router::add(). If you do that before the request gets routed, your dynamic routes will used.