Skip Navigation

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 23 replies, has 2 voices.

Last updated by Bobby 3 weeks, 6 days ago.

Assigned support staff: Bobby.

Author Posts
March 2, 2021 at 4:11 pm #8210257

raymondT-9

I am trying to: My base language is English and I have a French as my second language. English page can go to French page but French page always link to French page even I click English language button. (The language bar is at the bottom of the page.)

Link to a page where the issue can be seen: hidden link

I expected to see: From a French page, if I click English button link, it should to English page hidden link

Instead, I got: English button link to hidden link

March 2, 2021 at 10:58 pm #8212213

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

Reviewing your source code I can see that it indeed does point back to the wrong domain (French)

if possible try the following steps:

1. Go to Settings->General and ensure that your SiteURL and HomeURL are using the same domain, looks like one is using HTTP and the other HTTPS.

2. If the issue persists go to WPML=>Languages and test using a different language URL format, such as "Language name added as a parameter" and test the switcher

Let me know your results, please.

March 3, 2021 at 1:30 am #8212357

raymondT-9

Hi Bobby,

Thanks for your suggestion. I found out reason is that it just use http but not https.
Since I am using CloudFront CDN. It goes to origin server by http only. If I use https, it will cause other problems. Is there a way to force using https in WPML even it checked itself is using http connection?

Raymond

Screenshot 2021-03-03 at 09.28.35.png
March 3, 2021 at 2:02 am #8212507

raymondT-9

Hi Bobby,

I found out how to force https now. but I got another issue as in the attached image. For this issue hidden link, I found that another page mention:
https://wpml.org/documentation/getting-started-guide/language-setup/cannot-activate-language-directories/
If you use a CDN, such as Cloudflare, it may block languages in directories from working correctly by removing HTML comments. As a result, you may see a false-positive error, which shows a warning related to ?____icl_validate_domain=1 without any issues on the front-end.

So how to fix it? I am using CloudFront and connecting to server by 2 CDN name hidden link and hidden link

Raymond

March 3, 2021 at 2:03 am #8212509

raymondT-9

attach error image.

Screenshot 2021-03-03 at 09.28.35.png
March 3, 2021 at 7:11 pm #8221565

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

I am not seeing a warning in your screenshot, however, the warning you are referring to is related to the format "different languages in directories " which is not a format you are using.

You are using the format, "different domains per language".

How are you forcing https, in the backend I still see HTTP (in your screenshot) and in the front end I am still not able to use the language switcher.

March 4, 2021 at 2:55 am #8223117

raymondT-9

sorry, I uploaded the wrong page. I upload again.

Screenshot 2021-03-03 at 09.59.32.png
March 4, 2021 at 8:53 pm #8231923

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

This warning is not related to your URL language format and you can dismiss it.

It's only related to the format on languages in directories and would cause the site to show a blank screen in the front end, but most of the times it is a false positive.

Regarding the switcher, I am still not able to switch back and forth your languages.

1. I can see the domain is not validating, if possible please review with your hosting provider regarding this and ensure that everything has been set up as shown here:
https://wpml.org/tutorials/2016/04/use-wpml-different-domains-per-language/

2. You mentioned that you are using redirects?

March 5, 2021 at 3:29 am #8233347

raymondT-9

1. How to solve this "Not valid" issue? How to find the error of why is it not validating? What will it validate? Why does validation fail? Any log we can see?
2. no, we don't have redirect. We just used AWS CloudFront. Is there a WPML cookie need to whitelist in CDN?

March 5, 2021 at 11:21 pm #8239543

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

Before we dive deeper into the hosting setup,etc, please do the following test

Go to WPML->languages and switch to "Language name added as a parameter"
Test the front end, and let me know your results. If the language switcher persists, then continue with the steps below

These are great questions, however, they are more Hosting related than WPML, please contact your hosting provider and let me know their feedback.

The validation process (checking the box) "It will report if there are any problems with the validation, and then save all the settings that you have made."

If you can confirm that everything has been set up as shown in this doc
https://wpml.org/tutorials/2016/04/use-wpml-different-domains-per-language/

Then please enable the error log and share with me it's contents

You can see how to enable debug logging here:
https://wpml.org/documentation/support/debugging-wpml/

March 7, 2021 at 3:21 pm #8245711

raymondT-9

Yes, I have double checked everything set as the same as suggested in your page.

After I set "Language name added as a parameter", it can work without error.

Let me give you more details.
vchainstore.com -> CloudFront1 -> ELB-1 -> EC2-1 -> Apache-1
vchainstore.fr -> CloudFront2 -> ELB-1 -> EC2-1 -> Apache-1

any more suggestions?
Is the error related to "validation"?

March 9, 2021 at 2:51 am #8257831

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

March 10, 2021 at 7:07 am #8269615

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for the access details!

Please verify the username as I am getting the following error

Screen Shot 2021-03-09 at 11.06.42 PM.png
March 10, 2021 at 7:27 am #8269787

raymondT-9

Sorry Bobby. Maybe I made a mistake. Please try again now.

March 10, 2021 at 6:25 pm #8277861

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

It worked thank you!

The domains, are they both pointing to the same WP environment or do you have WP installed for each domain?

The topic ‘[Closed] the language link goes to the wrong domain’ is closed to new replies.