Get entity's database and space via formula field

Niche, but helpful. I’m working on improving SEO of public pages, and if I could encode the redirect url of an entity in a database, and have dynamically update if I choose to change the space or database name, that would be fantastic.

Scripting not possible due to being on free plan.

Adding a usecase: emailing a link to an entity via automation. If the space name or database name changes, the email links need to be changed by hand.