Yup, that’s the thinking. It can actually be done in multiple ways, one would be on blockchain level and regex is another option.
I’m pretty sure a smart dev could also do it with some js, intercepting clicked and redirect them. That’s what many ‘related content’ advertising solutions do and computationally it would be a lot less heavy (and thus cheaper) than have regex rewrite each URL on the fly when served.
EDIT: Included my link to my Utopian rant suggestion about the problem.