How to redirect links to a single domain in a multi-domain setup?
There is a special module for that: https://www.drupal.org/project/domain_path_rewrite.

The idea is to automatically rewrite the relative links to the absolute ones so they always point to the proper domain. Something like:

/**
 * Implements hook_url_outbound_alter().
 */
function domain_path_rewrite_url_outbound_alter(&amp;$path, &amp;$options, $original_path) {
  if ($domain_path = _domain_path_rewrite_domain_path($original_path)) {
    $path = $domain_path['url'];
    $options['external'] = strpos($path, '//') !== FALSE;
  }
}


Of course, is's only possible if you're printing the links programmatically. Otherwise nobody knows to which domain the links belong to and most likely you need custom rewrite rule.