• I’m not sure if this should even be possible technically, but using separate domains for identifying the language is not working on my multisite network.

    I have a multisite network setup with several alias domains mapped to sites within the network (using the default WordPress capabilities, no plugins), which is all working fine. I installed Polylang on the main site of the network, and want to use an alias domain for a secondary language. But the alias domain simply redirects to the main domain and the default language.

    • WordPress and Polylang are the latest versions
    • Setting up the alias domain in the settings went fine, no errors
    • Flushing the permalink settings didn’t help
    • Disabling plugins didn’t help
    • PLL_CACHE_HOME_URL constant didn’t help
    • Creating a page in the secondary language, say secondlanguage.com/subpage will also redirect to primarylanguage.com

    Main site: https://tycoonmedia.net/
    Secondary language alias: https://tycoonmedia.nl

    https://tycoonmedia.net/sample-english-page/ <- Works
    https://tycoonmedia.nl/sample-dutch-page/ <- Does not work

    • This topic was modified 6 years, 6 months ago by tyCoon Media.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Chouby

    (@chouby)

    Hi,

    I suggest that you use this plugin: https://wordpress.org/plugins/wordpress-mu-domain-mapping/ which has been tested and is compatible with Polylang.

    Hi @chouby,

    I can’t seem to make this work. Everything is in the latest version with Polylang and WordPress multisite. Is this a known bug?

    Hi @tycoon12344

    Did you ever manage to get this to work? Experiencing the same issues unfortunately.

    Thread Starter tyCoon Media

    (@tycoon12344)

    Hi @appscaptain

    Yes, we did get it to work, using the Mercator domain mapping plugin: https://github.com/humanmade/Mercator

    We did however run into Access-Control-Allow-Origin issues with Javascript, font files etc.

    Thanks a lot for the answer @tycoon12344! Appreciate it! Will try.

    P.S. Are you running nginx?

    P.P.S. Did you manage to fix the Access-Control-Allow-Origin? If you haven’t, as far as I know it has something to do with Cross-Origin Resource Sharing (CORS). And adding the domain that uses the javascript, font files etc. to the allowed domains in your webserver. Hopefully that helps.

    • This reply was modified 6 years, 2 months ago by appscaptain.
    • This reply was modified 6 years, 2 months ago by appscaptain.
    Thread Starter tyCoon Media

    (@tycoon12344)

    Nope, we’re on Apache. You could “fix” the CORS issue by just adding a wildcard to allow all domains to access those resources. But that’s not very good/safe practice in my view.

    Or just manually add the domains in question to the CORS whitelist. But that wouldn’t be very dynamic. I think the best way would be to automatically whitelist newly added aliases somehow, but we haven’t come that far yet.

    @tycoon12344 Thanks so much for your help! Can’t express how much I really appreciate you pointing me to Mercator. After trying to make this work for weeks, the domain redirection finally works! 😛 Thanks again for your help and have a great day!

    For anyone struggling with the same issue of Domain mapping not working with Polylang under a multisite setup please follow these steps:
    1. Park the domains you want to use for other languages under the main domain (eg. park domain.de under domain.com if you’re making a german localization). I can recommend VPSSIM which makes this easier. If you’re running your own VPS. Or check with your hosting provider about how to do that.
    2. Install https://github.com/humanmade/Mercator (replace the WordPress MU Domain Mapping if you already use that)
    3. Go under Network Admin > Sites > Edit Site > Aliases and setup the alternative languages domains.

    This seems to work under both nginx and Apache (according to @tycoon12344) – personally tested with nginx under WordPress 4.9.3.

    • This reply was modified 6 years, 2 months ago by appscaptain.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Domain mapping not working with multisite’ is closed to new replies.