Change URL multi-page app

While designing a multi-page app, I ran into difficulties when trying to modify the page’s url when the user does some action (such as clicking one of the points in a graph). I implemented the app mostly as described here and drawing inspiration from the structure of the dash-docs.

As mentioned, I would like to change the url after some action, so on my first page, i simply added this code:

@app.callback(Output('url', 'pathname'),
              [Inputs...])
def update_url(inputs..):
              return new_url

and this works quite well. However, on a separate page, I would like to do the same, but can’t as a single output can only have one callback.
Is there a different way of doing this, or perhaps a way of overriding the existing callback with a new one when the page changes?