[Resolved] Different Domain Per Language - DNS settings
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was experiencing issues with domain configuration for a multilingual WordPress site using WPML. They were working on a staging site and had issues with URLs not updating after changing the domain for the French version of the site, resulting in broken layouts and the language switcher not correctly redirecting to the corresponding language page.
4. We instructed the client to re-save the settings in Settings > General to update the WordPress and Site Address URL. 5. We noted that the Chinese Simplified and Traditional domains were not working because they were not pointed to the same site as the English and FR domains.
If the solution provided here is not relevant to your case, either because it's outdated or not applicable, we recommend opening a new support ticket. We also highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please contact us in the WPML support forum.
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.
Thank you for contacting WPML support, I'd be happy to help you with this issue.
All the second domains should be pointed to the same site (hosting IP) as the main domain of the live site.
The translation content is saved in the database so no matter if you translate the content on the staging site and push it to the live site.
Hello - so the domains are connected to the DNS and host
equiton.fr
equiton.ch
which will be 2 subdomains for simplified and chinese -
sc.equiton.ch
tc.equiton.ch
The domains points to the hosting ip but the url redirects to .com if you try accessing the domains. Please let me know if this setup is good to go.
No, please remove the redirection. Before using WPML, you need to setup second domains .fr,. .ch to point to the hosting IP and you can access your site from all domains .com, .fr, .ch without the redirection.
It’s easy to check if the domains are set up properly. Before you set the option in WPML, simply visit your new domains or subdomains. They should all show the same site without a redirection.
For example, if you have the domains “example.com” and “example.de” (and WPML is deactivated) you should see the same content when you visit any of these domains.
Hello - it works when i uncheck the validate on save, but all the links now break. Is there a way to auto update the links without impacting our pages? Thanks
Can you please share some screenshots of the break links? Also, I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. Your next reply is set to private to share the info.
❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.
Can you please setup different domains per language on the staging site so I can see the issue? And let me know what is the internal link or section that you are checking.
Or share the access to your live site so I can check it directly.
Hello - i cant share access to the live site, because once you change the domains to urls our language swticher breaks. I have added the domains on the language section on the staging site. The problem is this - lets assume currently we are using different directories for our languages - take for example French - so here is a link hidden link
As you can see - its using the directory. Now once we change the domain to equiton.fr - this link breaks because its using the directory url - how can we auto update all the language links once the domain has changed on the respective pages - this is what is happening.
Please add these domains on staging
hidden link - Simplified Chinese hidden link - Traditional Site hidden link - FR Site
If I understand correctly, for example, you add a link to the page hidden link
from the homepage. Now you change the URL format to a different domain per language, the URL is invalid.
I suggest you try two points:
1. Use a search and replace plugin to replace the old URL with the new URL. For example: hidden link
to hidden link
Here are the steps i took - i am doing all of this on the staging site so i am going to post staging URL's.
This is our staging site hidden link
Before updating the domain on the language section of WPML the FR URLs looked like this hidden link
I have set a staging domain for the French Site hidden link
I have run a search and replace to search for hidden link and replace with hidden link
I have saved the permalinks but not all of them get updated. Some pages still have the old url. The result is that the layout is also broken - see example page hidden link
Also on the language switcher on the top right - if i go back to EN it does not take me back to the FR page. If you want to see the backend, please don't make edits on the existing access. I have a new staging site, specific to testing this. I can provide access if required.
I don't see the different domains per language enabled on the new staging site, because when I switch to French language, the URL shows the directory /fr/ hidden link
I can switch back and forth to English, French language on this page without any issues. Please enable the option different domains per language on this site, share a screen record of the issue on your end and let me know "Some pages still have the old url".
If you are testing on another site, please share the credentials of that site in your next reply.
and go to Settings > General > Re-save settings to update the WordPress and Site Address URL.
I also notice that only the FR domain is working, the Chinese Simplified and Traditional domains are not working because they are not pointed to the same site as the English and FR domains.
Can you please explain a little bit more about what you did with the code in the wp-config.php - once we move this to the production site, will the same have to be done.
The language switcher is now working between EN and FR. I have also pointed the Chinese Sites to this development environment.
I am running into the following issues still - some URL's on the FR site are not updating with the .fr domain. Also some pages have layout issues after running updating the layout. Please see URL's
Layout Issue - hidden link
URL Not Updating - hidden link
This layout issue first happend when i did a search and replace, but i restored a backup to the search and replace and still see the issue.
So it seems across all 3 languages the URL's are not updating but also there are layout issues.
Thanks for looking into this
New threads created by Long Nguyen and linked to this one are listed below: