• antcw

    (@antcw)


    I have three subdomains. For example

    one.domain.tld
    two.domain.tld
    three.domain.tld

    one.domain.tld is my main wordpress site. All three subdomains have the same documentroot and have been added as multiple domains in general settings.

    I want to be able to go the main site (one.domain.tld) and have links to the other two subdomains from that site. However the links get rewritten to one.domain.tld. Is there a way to avoid this?

    Thanks

Viewing 1 replies (of 1 total)
  • I had the same problem today. When you check to source code you can find :
    add_filter(‘the_content’, [ $this, ‘fixContentUrls’ ], 20);

    Which it search in the content and modify the link domain(if it was different) for the currently domain.

    You just need to add an action in your child’s theme functions.php like this :
    function remove_fixContentUrls()
    {
    if (!class_exists(‘MultipleDomain’)) {
    return;
    }
    $multipleDomain = MultipleDomain::instance();
    remove_filter(‘the_content’, array($multipleDomain, ‘fixContentUrls’), 20);
    }

    add_action(‘init’, ‘remove_fixContentUrls’);

    And it works fine for me. I hope it helps you and other as well

Viewing 1 replies (of 1 total)
  • The topic ‘Stop rewriting of links to one of the multiple domains’ is closed to new replies.