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. would automatically change to

Is there any way I could achieve this?