The UrlRewrite Module. And so the urlrewrite rules use an additinoal entry inside the routerList. This entry has the sort order of 20.
<type name="Magento\Framework\App\RouterList">
<arguments>
<argument name="routerList" xsi:type="array">
<item name="urlrewrite" xsi:type="array">
<item name="class" xsi:type="string">Magento\UrlRewrite\Controller\Router</item>
<item name="disable" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="string">20</item>
</item>
</argument>
</arguments>
</type>
This routerlist is traversed inside the Magento\Framework\App\FrontController
. The first one which matched your route is used.
Before the urlRewrite only the RouterList of the module-robots is used.
If i think about which RouterList maybe processes the routes.xml
iSo I would guess that url-rewrite takes precendence before routes.xml, but i didn't dig further into it yet.
*edit:
What checks for the routes.xml inside the frontend is not the default router out of. But the standard router, which is also defined in the module-storesstore di.xml and is located in.
Magento\Framework\App\Router\Base
. This one actually has a sort order of 100. This would mean that the routes.xml30 and is checked as very last, if it matched your routeprocessed directly after the url-rewrites.
So I would guess that urlThe default router which is also defined in module-rewrite takes precendence before routes.xmlstore, but i didn't dig further into it yetis only for processing the no-route pages.