• Hello!

    I have a big issue when using Polylang 1.7.8 in a multisite network environment.

    If I go to a subpage, I land in an endless loop. It’s switching back and forth between the main page and the subpage.

    It has clearly something to do with Polylang (if i disable it, everything is OK) and with the flush rewrite rules.

    Can you please help?

    What is a possibility to achieve a working network? Installing the plugin on every subpage separately?

    Thanks in advance
    David

    https://www.ads-software.com/plugins/polylang/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter vielhuber

    (@vielhuber)

    I now have a clue:

    I’ve chosen a Domain Mapping in subdomain format:

    Main page:
    https://mainpage.tld.com

    Subpage:
    https://subpage.tld.com (mapped primary domain)
    https://mainpage.tld.com/subpage (standard wordpress subfolder domain)

    The loop happens if I go to https://subpage.tld.com/de/,
    it loops between
    https://subpage.tld.com/de/
    and https://mainpage.tld.com/subpage/de/

    Somehow polylang is not aware of the mapped primary domain!

    Any help would be appreciated.

    Thread Starter vielhuber

    (@vielhuber)

    Further investigation:

    It has something to do with the start page of the subpage:

    If I create another page and go directly to it, everything works fine.

    Only the page set as frontpage loops endlessly between
    https://subpage.tld.com/de/ and https://mainpage.tld.com/subpage/de/

    Thread Starter vielhuber

    (@vielhuber)

    It has something to do with the Domain Mapping:

    See here another thread with exactly the same issue:
    https://www.ads-software.com/support/topic/homepage-infinite-loop

    Is this really true that I can’t use Polylang together with Multisite + Domain Mapping?

    Plugin Author Chouby

    (@chouby)

    Hi!

    Is this really true that I can’t use Polylang together with Multisite + Domain Mapping?

    Yes you can. I know at least one user who has a multisite live with Polylang and domain mapping. I am not a multisite and domain mapping specialist though. Maybe not all combinations are possible.

    Are you using this domain mapping plugin?
    https://www.ads-software.com/plugins/wordpress-mu-domain-mapping/

    Thread Starter vielhuber

    (@vielhuber)

    Hi!

    Yes I use this plugin.

    I have now found a solution: Putting this inside wp-config.php

    define(“PLL_CACHE_HOME_URL”,false);

    solves all problems.

    Why is this nowhere documentated?
    What are the downsides of this solution?

    I have another new error after disabling this cache:

    switch_to_blog(2);
    echo pll_home_url();
    restore_current_blog();

    returns the wrong URL (the one of the main page).

    Plugin Author Chouby

    (@chouby)

    Yes I use this plugin.

    Could you precise your domain mapping settings, Polylang settings, and whether you use a static front page or not?

    Why is this nowhere documentated?

    It is

    What are the downsides of this solution?

    Just a small performance impact. However, the option has been created for websites having two domains. I never needed it for standard multisite.

    I will test the other issue.

    Thread Starter vielhuber

    (@vielhuber)

    OFF Remote Login
    ON Permanent redirect (better for your blogger’s pagerank)
    ON User domain mapping page
    ON Redirect administration pages to site’s original domain (remote login disabled if this redirect is disabled)
    OFF Disable primary domain check. Sites will not redirect to one domain name. May cause duplicate content issues.

    Main site: Only have one domain and no other domain mapped
    Sub site: I have another domain attached to it as primary domain

    If you like I also can give you short access to the backend where you can reproduce the problem immediately.

    Perhaps we can meet in Skype if you want to?

    Plugin Author Chouby

    (@chouby)

    OFF Disable primary domain check. Sites will not redirect to one domain name. May cause duplicate content issues.

    Sub site: I have another domain attached to it as primary domain

    Maybe that’s the problem.

    I make my own tests always with the primary domain check disabled because it conflicts with Polylang when using multiple domains.

    I don’t reproduce your other issue with pll_home_url. Here is my test plugin:

    <?php
    /*
    Plugin name: Test multisite
    */
    
    add_action('pll_language_defined', 'pll_test_multisite');
    
    function pll_test_multisite() {
    	switch_to_blog(2);
    	error_log( pll_home_url() );
    	restore_current_blog();
    
    	switch_to_blog(3);
    	error_log( pll_home_url() );
    	restore_current_blog();
    }

    I wait for ‘pll_language_defined’ action to be sure that the call to pll_home_url makes sense.

    Conditions of the tests are:
    * Multisite network based on subdomains, not dubdirectories.
    * Polylang and test plugin network activated. Both sites has same language.
    * One Domain mapped to site 2, site 3 is just a subdomain of the main one
    * One domain per language on site 2, One subdirectory per language on site 3

    Thread Starter vielhuber

    (@vielhuber)

    I make my own tests always with the primary domain check disabled because it conflicts with Polylang when using multiple domains.

    That’s the case. If I disable it, I am not able to use another domain for a sub site (it is redirected, but that is not what I want).

    Do you hook into functions like get_permalink()?
    These functions also behave now different with define(“PLL_CACHE_HOME_URL”,false);

    Plugin Author Chouby

    (@chouby)

    Do you hook into functions like get_permalink()?

    Yes. Polylang hooks into almost all links functions to add the language information in the url.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Polylang breaks Multisite network (endless loop)’ is closed to new replies.