Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
Yesterday I tried to activate the Multi-domain functionality, it all seems to work wonderfully, but for one exception: When I activate the multi-domain functionality, all the wp-admin ajax calls are done to the first domain (covid19.groupealliances.com)

Solution:
There is issue when you use “Different domains per language” and Nginx server configured with server_name that does not match your domain name.

Replace:

$url_parts['host'] = $_SERVER['SERVER_NAME'];

- in wp-content/plugins/sitepress-multilingual-cms/classes/url-handling/converter/strategy/class-wpml-url-converter-domain-strategy.php

with:

$url_parts['host'] = $_SERVER['HTTP_HOST'];

Relevant Documentation:
- https://wpml.org/errata/possible-nginx-issues-with-different-domains-per-language-setting-when-doing-a-rest-api-call/

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 24 replies, has 2 voices.

Last updated by Dražen Duvnjak 4 years, 5 months ago.

Assisted by: Dražen Duvnjak.

Author Posts
May 21, 2020 at 2:27 pm #6187429

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Thank you!

I have been advised by the 2nd tier to check the issue locally and try to reproduce it.

After that, I will be providing all information to our developers' team and escalating this ticket for them to check and provide a fix.

I would like to kindly ask you to provide a duplicator copy of your website.

In the meantime I will try to reproduce the issue on a clean new install following similar steps as what caused your issue.

Please follow the next steps for providing duplicator copy:

1. Install the Duplicator plugin

The Duplicator plugin is free and can be downloaded from the WordPress repository.

2. Create the support package with the copy of your site

3. Share both files

Please share both of these files. You may use any file sharing service that you prefer.

More info: https://wpml.org/faq/provide-supporters-copy-site/

I have marked your next reply as private.

Thanks,
Drazen

May 21, 2020 at 4:27 pm #6188493

benjaminG-28

Here's the link

hidden link

May 22, 2020 at 10:58 am #6194673

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Thanks!

I have checked and couldn't get the same issue when migrating your website to our servers or reproducing it on a clean install.

I have escalated this ticket to our developers and they will be checking the issue.

I will be marking this ticket as "Escalated to WPML developers team" and I will update you as soon as I have some updates from the developers' team.

Thank you for your patience.

Regards,
Drazen

May 22, 2020 at 8:07 pm #6198139

benjaminG-28

So if I understand correcly, when you transfer the website yo your servers, there is no bug when activating the multiple domain option ?

You see that in the landing page, there is no mention to "covid19.groupealliances.com" on any lines ?

May 23, 2020 at 7:35 am #6200079

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

yes that was the case when I tested it, but maybe I was not doing replicating steps correctly since I haven't used real domains but hosts manipulation.

Let's wait for an update from our developers, maybe they will be able to replicate it correctly.

I will update you as soon as I have some information.

Thanks,
Drazen

May 26, 2020 at 3:10 am #6214711

benjaminG-28

Any updates ?

I need to fix this really soon...

May 26, 2020 at 5:56 am #6215567

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

our developers are still checking the issue.

My apologies for any inconvenience caused, but be sure we are giving our best.

If the issue is a bit complicated to replicate, it can take some time before we are able to check and provide any solution.

I will update you as soon as I have some news.

Hopefully, it won't take too long.

Regards,
Drazen

May 27, 2020 at 8:11 am #6226941

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

sorry to keep you waiting.

It seems there is issue when you use “Different domains per language” and Nginx server configured with server_name that does not match your domain name.

Can you please try next workaround:

Replacing SERVER_NAME with HOST_NAME:

$url_parts['host'] = $_SERVER['SERVER_NAME'];

in wp-content/plugins/sitepress-multilingual-cms/classes/url-handling/converter/strategy/class-wpml-url-converter-domain-strategy.php

$url_parts['host'] = $_SERVER['HTTP_HOST'];

More info: https://wpml.org/errata/possible-nginx-issues-with-different-domains-per-language-setting-when-doing-a-rest-api-call/

Please let me know how it goes.

Thanks,
Drazen

May 27, 2020 at 3:09 pm #6230649

benjaminG-28

Great news !!

I found a way to make it work without much trouble :

The original setting in my nginx was :

server_name covid19.groupealliances.com boutique.groupealliances.com shop.groupealliances.com;

So I updated it to this:

server_name boutique.groupealliances.com shop.groupealliances.com covid19.groupealliances.com;

Seems like the

 $_SERVER['SERVER_NAME'];

uses the first domain in the server_name, so switching the order of the domains in the nginx config file fixed my issues.

May 28, 2020 at 12:25 pm #6239143

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Great! 🙂

Glad to hear your issue is now solved, I will be sharing your fix with our developers.

I will be closing this ticket and marking it as resolved.

I hope I was helpful. Don't hesitate to ask if you find any problem in the future, I'll gladly help you.

Regards,
Drazen