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 13, 2020 at 11:18 pm #6126797

benjaminG-28

I am trying to:

I recently changed my domain name from : covid19.groupealliances.com to boutique.groupealliances.com. WPML had been added to the previous domain and migrated to the second.

I followed all the recommended steps to complete the transfer, and nothing works out of place. I even registered the new domain name with WMPL and got a new licence for the new domain name

Yesterday I tried to activate the Multi-domain functionnality in WPML, having my french domain name be: boutique.groupealliances.com AND the english version be shop.groupealliances.com

It all seems to work wonderfully, but for one exception : When I activate the multi-domain functionnality, all the wp-admin ajax call are done to the first domain (covid19.groupealliances.com)

When I desactivate the multi-domain handling of translations, the problem is fixed.

Link to a page where the issue can be seen:

You'd need to login, but I provided a screenshot where you can see WooCommerce's dashboard calling the old domain name

I expected to see:

For some reason, WPML is making the redirection go to the original domain...

I tried to find this setting, but i am absolutely blind. there is nowhere I can acttually change the domain or URL setting that I can see. Any idea on how I could fix this ?

Thanks !

Screen Shot 2020-05-13 at 7.15.05 PM.png
May 15, 2020 at 3:25 am #6137297

benjaminG-28

Any updates ?

May 15, 2020 at 8:05 pm #6143921

benjaminG-28

... I need help guys...

May 16, 2020 at 4:58 am #6145627

benjaminG-28

Hello there, just making sure you're still there...

May 16, 2020 at 6:20 am #6145791

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

sorry for waiting, we have a bit higher queue these days.

1) I followed all the recommended steps to complete the transfer, and nothing works out of place.

> Can you please clarify which recommended steps?

2) Does this happen only on a specific page (WooCommerce's dashboard) in the backend or all others also?

Please make a backup before proceeding.

3) Go to WPML>Support>Troubleshooting>Run options under cleanup

Info: https://wpml.org/documentation/support/wpml-troubleshooting-options/

Please let me know how it goes and don't hesitate to ask if you find any problem along the way or have doubts or questions about the steps mentioned above, I'll do my best to help you in the best way possible.

Regards,
Drazen

May 16, 2020 at 9:33 pm #6148663

benjaminG-28

Hello !

Actually, I changed the URL on the Settings -> General for the website URL.

Funny thing is that everything works perfectly, even the woocommerce dashboard, untill I activate the multi-domain setting in WPML.

As far as I can see it's the only URL that has been affected.

I tried all the tools in number 3, the Troubleshooting Run options, and nothing helped..

I turned off the nulti-domain translation, and the problem is fixed. I turn it back on and the problem comes back... Any ideas on where the URL setting may be stored ? I might have to edit that setting manually somehow...

May 19, 2020 at 11:11 am #6166435

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

You will need to check the MYSQL database and update/change the domain to the new one.

I would recommend next steps:

- Make a backup of your database
- Use the search option and search for covid19.groupealliances.com
- Check what field hold old domain info and replace with new one
- Change one field per one so you can revert back if needed

There are other ways also, you can use plugins or SQL codes to automatically change it.

I would suggest checking next:
- https://toolset.com/faq/how-do-i-migrate-a-wordpress-site-from-one-domain-to-the-other/
- hidden link
- https://wpml.org/forums/topic/how-to-move-a-wp-site-with-wpml-the-right-way/

Please let me know how it goes and if you need my help.

Thanks,
Drazen

May 19, 2020 at 1:29 pm #6167915

benjaminG-28

I already followed all the steps in the first article. In fact that is how I changed the domain name.

I also performed a find and replace on the website.

Is it possible that something is being stored in a PHP serialized array ? My guess is that it's something related to the WPML extension... since desactivating the multi-domain support fixes all problems..

The thing is that I need both to work.

May 19, 2020 at 1:34 pm #6167993

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

thanks for the feedback.

It could be, but if possible I would like to have a look at the issue and then check with our 2nd tier on this issue.

In order to investigate this issue and to understand it better, I would need to access your website.

Please make a full backup of your site (files and database) and confirm it in your next reply. I might need to enable/disable plugins, switch themes and access your website database.

I would need to access both your site's wp-admin and FTP account. Be sure to provide both.

I have enabled the private username and password fields in your next reply.

I suggest you create a temporary user, set it as an administrator and then add those credentials in the private fields mentioned.

You can safely add your information into these fields.

Thanks and regards,
Drazen

May 20, 2020 at 7:14 am #6174355

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

I have checked your website, haven't changed anything major.

- Resaved permalinks
- Added DB plugin to download DB
- resave domain WPML settings

1) I see you are still using covid19.groupealliances.com domain and it is showing French version same like boutique.groupealliances.com. Can you please share more info, I am not sure are you using still old domain directory and old domain, but it is redirecting to new or?

Wordpress is still loading files from /home/forge/covid19.groupealliances.com/public
since this WordPress installation directory, the same goes for plugin directory etc.

If I visit covid19 wp-json, it si showing URL as boutique, since it is not the same as the original URL visited it is being blocked. There is a workaround for this, it will still load covid19 domain but this time it will work.

More info: https://wpml.org/forums/topic/post-image-thumbnail-not-loading-also-yoast-seo-things-there-is-no-image/#post-3580709

2) You should disable X-Frame_Options to SAMEORIGIN. on your server as explained here:

- https://wpml.org/errata/single-sign-on-feature-not-working-due-to-setting-the-x-frame-options-to-sameorigin/

3) I have checked your database, and there are still 1763 mentions of covid19.groupealliances.com. Can you please try making a BACKUP of DB and then manually changing this URL with the new one.

Please let me know how it goes.

Thanks and regards,
Drazen

Screenshot_4.jpg
Screenshot_2.jpg
May 21, 2020 at 4:12 am #6182965

benjaminG-28

Thank you very much for your answer.

Yes, so I didn't change the location on the server that contains the files to the website, but that should not make any difference.

I will be adding a permanent 301 to all trafic from that domain as soon as we fix this issue...

I turned off the XFrame-Options for the domain as well.

I replaced all the covid19.groupealliances.com references from the database, other than the absolute paths on the server.

I also noticed that on the homepage, the location of the API URL's also changes when activating / desactivating WPML multi domain settings. This confirms that the problem is with WPML....

Did you have any success escalating the request to the next level ? I believe this has to do with WPML and that the update will be very easy once we find it...

Thanks

Screen Shot 2020-05-21 at 12.07.00 AM.png
Screen Shot 2020-05-21 at 12.07.42 AM.png
May 21, 2020 at 5:00 am #6183301

benjaminG-28

So I just noticed that WPML is changint the Rest API URL.
It seems that the problem only occurs with Rest APi endpoints that do point pack to the original domain once I change the settings in WPML... I really need to fix this soon.

May 21, 2020 at 5:43 am #6183343

benjaminG-28

It seems to happen everytime that wordpress uses :

esc_url_raw()
esc_url()

This might help find the issue...

May 21, 2020 at 9:16 am #6184943

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

thanks for testing and sharing additional info.

I have just forward all information to our 2nd tier and waiting for their response.

I am sorry this is taking a bit longer, but we have a process and steps to test the issue and try to fix it before we can escalate it further. Since it is a specific issue we needed you to check and try our fixes in order to make sure it is not working and solving your issue.

I will update you soon.

Thanks and regards,
Drazen

May 21, 2020 at 2:05 pm #6187327

benjaminG-28

No problem !
I appreciate your help. I will be waiting on 2nd level assistance