Skip Navigation

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

Problem:
The issue involves the href for English on the website pointing to the .de domain instead of the expected .com domain. This problem surfaced after changing the plugin to use the new .de domain instead of a /de subdirectory. The attempted fix using JavaScript is considered less than ideal.

Solution:

1. Verify language domain setup per WPML documentation, ensuring different domains per language are correctly configured.

2. Investigate the hosting provider's feedback and assess any unusual code in the wp-config.php file.

Remove any code overriding default domain behavior from wp-config.php and ask the hosting provider to configure parked domains properly.

Relevant Documentation:

WPML Language URL Options: https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/how-to-use-wpml-with-different-domains-per-language/

Configuring DNS settings for separate domains per language: https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/how-to-use-wpml-with-different-domains-per-language/#2-configure-the-dns-settings
Keywords:
WPML, Language Domains, Href Issue, Default Language Settings, URL Configuration, DNS Settings, Troubleshooting, Parked Domains, wp-config.php, JavaScript.

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.

Tagged: 

This topic contains 13 replies, has 2 voices.

Last updated by Bobby 1 year, 6 months ago.

Assisted by: Bobby.

Author Posts
October 23, 2023 at 10:03 am #14636215

joH-4

Link to a page where the issue can be seen:
hidden link
or any other .de page

I expected to see:
the href for English to be .com

Instead, I got:
the href for English is set to .de

---

We recently changed the plugin to use the new .de domain instead of a /de subdirectory

For now I tried to fix it using Javascript and this works but is far from ideal. (This also means the issue won't be visible unless you inspect the view-source)

Screenshot 2023-10-23 120527.png
October 24, 2023 at 6:49 am #14642507

Bobby
WPML Supporter since 04/2015

Languages: English (English )

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

Hi there,

Please verify that you are setting up the different domains per language per our documentation

https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/how-to-use-wpml-with-different-domains-per-language/

Let me know your results, please.

October 27, 2023 at 7:16 am #14675447

joH-4

We have followed the documentation when setting up the menus
The issue still seems to persist unfortunately

October 27, 2023 at 8:04 pm #14682119

Bobby
WPML Supporter since 04/2015

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

October 31, 2023 at 7:16 pm #14703379

Bobby
WPML Supporter since 04/2015

Languages: English (English )

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

Hi there,

I believe I see the issue.

Your default language (WPML->Languages) is set to English.

With the URL Format "different domain per language" you have correctly set the domain to .de for German, but the English domain is also by default set to .de

If I go to WordPress->Settings->General, I can also confirm the SiteURL and HomeURL in the database are set to the .de domain.

In this case, you would want German to be the default language and English secondary with the .com set as the domain.

Otherwise, you can keep English as the default language but you will need to work with your hosting team to change the URL of your site to the .com one.

Without WPML activated for example your site's URL is .de and not .com.

Let me know your results, please.

Screen Shot 2023-10-31 at 12.13.17 PM.png
November 7, 2023 at 10:18 am #14745823

joH-4

So changing the default language on the .de admin to German would fix the issue?
Would that not also change the default language on the .com? Or are those two seperated from each other?

Edit: I tried to change the default language and it resulted in the same issue, but now it was the .de that did not point to the correct url.
I did undo this action though by putting back a backup.
Any idea how this could be fixed?

Maybe to be sure: the .de is a parked domain on our server.

November 8, 2023 at 6:21 am #14752887

Bobby
WPML Supporter since 04/2015

Languages: English (English )

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

Thank you for updating us!

This does not sound correct, can you please let me know what the domain URL is when WPML is not in use?

Please contact your hosting provider and provide them with the above documentation shared here:
https://wpml.org/forums/topic/menu-redirects-back-to-main-language-wrongly-when-using-a-different-domain/#post-14642507

Ask them to verify that everything is currently set up as expected, as this is outside our plugin's control.

Let me know your results, and the hosting provider's feedback, please.

November 9, 2023 at 9:24 am #14763827

joH-4

When WPML is not set up the domain URL should be getahead-asia.com.

I will notify our hosting provider to see if they know anything, thank you.

November 9, 2023 at 10:55 am #14764901

joH-4

We have contacted our service host, they are looking into it. I will get back to you the moment they do.

November 9, 2023 at 7:44 pm #14770789

Bobby
WPML Supporter since 04/2015

Languages: English (English )

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

Got it, yes that looks like they might need to review this.

Let me know their feedback, please.

November 13, 2023 at 8:30 am #14786137

joH-4

Hello, we have contacted our server host and they came back:
the server and domain settings seem to be correctly set up, the only thing they noticed as odd was the code that set the WP_HOME and WP_SITEURL to 'hidden link'.$_SERVER['HTTP_HOST'])

this was done to override the default behavior of the parked domain, initially the .de would simply redirect to .com, and not stay to show the translations. This code fixed that; but now we are wondering if that could influence the workings of the wpml-plugin

Could that cause the issue?

Screenshot 2023-11-13 092711.png
November 13, 2023 at 9:38 pm #14792555

Bobby
WPML Supporter since 04/2015

Languages: English (English )

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

Hi there,

Yes, that code in your wp-config.php would cause the issue we are seeing here and has been known to cause issues in the past with other behaviors as well.

If possible, please remove it and ask your hosting company the following:

"When using separate domains: I want to add a parked domain (alias) to my existing domain. My existing domain is “example.com”. I want to park the “example.de” domain."

They should be able to fix this without the need of that code.

See more info here:
https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/how-to-use-wpml-with-different-domains-per-language/#2-configure-the-dns-settings

Let me know your results, please.

November 14, 2023 at 12:09 pm #14797341

joH-4

Thank you for your insight. We will try it out.

Edit:
After removing the code, the site seems to work as expected.
The issue is resolved.
Thank you for your help!

November 14, 2023 at 4:14 pm #14800689

Bobby
WPML Supporter since 04/2015

Languages: English (English )

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

Glad to hear that the issue has been resolved!