I think you can achieve this by simply adding a redirect in the web.config for the domain and exclude /episerver from it.
Its possible to specify edit and primary domains in admin mode. Edit will be used for edit mode only and primary will be the link used for view on website:
Since you mentioned headless it depends on your implementation but the primary host name type is normally used for URL generation for links etc. This is described in the official documentation: https://webhelp.episerver.com/latest/en/cms-admin/managing-websites.htm as described below:
We are building a new site where we use Episerver as a headless CMS. The frontend is a different application alltogether on a different domain. I need to change the "view on website" link in Episerver edit mode to go to a different url, is there a way to modify this link?