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

Last updated by Noman 11 months, 4 weeks ago.

Assisted by: Noman.

Author Posts
June 20, 2024 at 12:41 pm #15763631

mischaR

Background of the issue:
I am trying to have one website for two different domains - staging sites: hidden link (NL is primary) and hidden link (BE is secondary). Both domains are hosted on AWS Route 53 and pointing to a Lightsail instance with static IP address (15.236.120.238). The primary NL domain name is hardcoded to wp-config and added again to the WP database. WPML is set to always show the default version of a page/post if no translation is available. No translations have been done so far. I have cleared the WPML cache, checked .htaccess, and tried incognito mode and different devices/networks.

Symptoms:
The language switcher on the secondary domain (BE) does not contain a link to the primary domain (NL). The primary and secondary flags both link to the BE version.

Questions:
Why does the language switcher on the secondary domain (BE) not link to the primary domain (NL)?
How can I configure WPML to ensure the language switcher links correctly between the primary and secondary domains?

June 21, 2024 at 9:16 am #15772992

mischaR

Hi team,
When setting the language setting to folders instead of separate domains, it works as expect: on /be, the NL flag links to /nl.
Any idea on how we can ensure this behaviour will also work when we set it to use different domains?
Thanks!

June 23, 2024 at 7:41 am #15792538

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Sorry for the delay, I was off during the weekend (Friday-Saturday). Thanks for checking it.

To take a closer look at this issue, please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and debug the issue.

I’ve enabled a private input box for your next reply.

=== Please backup your database and website ===

✙ I would additionally need your permission to deactivate and reactivate Plugins and the Theme and to change configurations on the site. This is also a reason the backup is really important.

Thank you

June 24, 2024 at 3:52 pm #15809109

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for sharing the login details. The wp-admin login info works fine for me, but the FTP login info is not working. Here are the steps I took to debug the issue:

1. I checked the “siteurl” and “home” fields in the wp_options database table and corrected the URL, removing the extra "http" as shown in the attached screenshot.

2. I checked the issue in a minimal environment by deactivating all plugins.

3. I noticed that the WordPress Address (URL) and Site Address (URL) fields are disabled in Settings >> General. This usually happens when these values are defined in the wp-config.php file. I tried to remove the WP_HOME and WP_SITEURL constants from the wp-config.php file, but the fields are still disabled.

I suspect the wp-config.php file is not being applied to the site or another file is overriding it. Can you please try to follow the below steps and let me know how it goes:

1. Please try to remove the WP_HOME and WP_SITEURL constants and then re-save the site URL from Settings >> General page?

2. Please re-save the permalinks from the Settings >> Permalinks page by pressing the Save Changes button.

3. Please delete all sorts of caches on your site/server cache if any / plugin cache / CDN cache, clear the browser cache, and then see if it resolves the issue afterward.

Thank you

siteurl wrong.jpg
June 24, 2024 at 9:33 pm #15811858

mischaR

Thanks Noman,
I set the site WP_HOME and WP_SITEURL in wp-config to their standard dynamic values, and added these lines to functions.php:

update_option( 'siteurl', 'hidden link' );
update_option( 'home', 'hidden link' );

This has resolved the issue. Many thanks for your help!