например:
router.beforePush = (url) => '/foo' + url
И history.push('/bar') следует перенаправить на '/foo/bar'
history.push('/bar')
'/foo/bar'