Is it possible to front the standard URI-based router with a domain-based router?
My site supports several subdomains and it would be nice to pack their functionality in modules as everything else (database, models, extra classes) is shared. I can create a module and it'll work fine, but I can't specify it to be the default module for any given subdomain. The need for modules is compounded by the fact that for other devs using subdomains is more difficult to set up then plain routes as it would involve editing the hosts file. A snag here is that subdomains and modules don't neccesarily map 1:1, as some urls in the base application will already be taken.
Any routes in the module would be of the same form used by the base application, as opposed to repeating their own name (which is also a DRY violation).
The webserver simply points to different directories besides public, with each of them having their own index.php and assets.
The best option would be a URI "pre-treater", a class method which would get the current URI, and convert it to a format suitable to be processed by your application.
You can call your method via the config key "security.uri_filter", in app/config/config.php. It gets the current URI as a parameter, and it should return the modified URI as a string.
Good idea, this could do it. I'm thinking it would perhaps be easier to always use a module and not do any MVC in the base application. Depending on the URL, a default module could then lay claim to the router.