You can see this in action on the Eleventy Twitter Archive, where any links to https://twitter.com/zachleat/ now link to https://zachleat.com/twitter/ instead.

e.g. https://twitter.11ty.dev/1238956883488235520/