You should look at the PageUrlProviders (https://bitbucket.org/actoas/composite-c1/src/6467a650c8a106bf441793a8adf338d346758396/CompositeC1/Composite/Core/Routing/Plugins/PageUrlsProviders/?at=default)
It has some interfaces that you can implement that basically takes a PageId as input and returns a string.
You can see how the Default provider is implemented here https://bitbucket.org/actoas/composite-c1/src/6467a650c8a106bf441793a8adf338d346758396/CompositeC1/Composite/Plugins/Routing/Pages/DefaultPageUrlProvider.cs?at=default and you can then make your own and register it in composite.config.
It has some interfaces that you can implement that basically takes a PageId as input and returns a string.
You can see how the Default provider is implemented here https://bitbucket.org/actoas/composite-c1/src/6467a650c8a106bf441793a8adf338d346758396/CompositeC1/Composite/Plugins/Routing/Pages/DefaultPageUrlProvider.cs?at=default and you can then make your own and register it in composite.config.