The following seems to work all right, but it doesn't take into account the site. Any other ideas?
if (DocumentContext.CurrentDocument.NodeLinkedNodeID > 0)
{
Response.RedirectPermanent(CMS.DocumentEngine.TreePathUtils.GetAliasPathByNodeId(DocumentContext.CurrentDocument.NodeLinkedNodeID));
}