Description
Hello :
As you can see in this issue : symfony/symfony#26949
It seems that all routing files in config/routes are loaded automatically and it will ignore the prefix.
So you should group routing files by prefix in different folders :
This is working
app_security: resource: 'security/security.yaml' prefix: /security
This is not working
app_security: resource: 'security.yaml' prefix: /security
Quoting @stof :
Well, the Flex kernel is indeed loading all files in routes itself. and this means that the loading of the file done in the kernel might happen after the loading of the file done by your own file (which is likely here, as security.yml comes after routes.yml and so the route definition without prefix wins over the route definition with a prefix.
If you want to split the routes into separate files loaded with a prefix, putting them in a subfolder is indeed a solution.
I suggest adding a warning in the doc about it.