How to make article links domain-independent

Hi everyone, I’m setting up my blog with some old data, and I’m trying to have a long-term solution to the fact that I often end up changing base url or just the sub-domain. More specifically, I often link from one article to another, but I’d like to make these links “dynamic” so that if the baseurl changes, they will all still point to the correct destination (i.e. https://myblog.mydomain.com/my-ghost-article/ would automatically change to https://myblog.myotherdomain.com/my-ghost-article/)

Is there any way I could achieve this?