It works in admin because both site are in the same vhost mapping. But not in portal because then they are in 2 different mappings.
So I can think of 3 solutions (but somebody has maybe found a better solution)
You put these two sites in a same vhost: You could have a mapping “insert-domain.com/pilot” -> “/portal/master”. But it might be problematic if there are some other unrelated sites, so maybe:
Put these two sites under a common parent and have a mapping “insert-domain.com/pilot” -> “/portal/master/parentname”
Or you create the URL yourself. You know what host the link is supposed to point to, and you can retrieve the content path and concatenate both. But then the link in admin would not be the one you want