Background of the issue:
I'm trying to make my languages work on different domains. Main site is thermex.lv. Other domains are: thermex.ee for Estonian, thermexlt.lt for Lithuanian, ru.thermex.lv for Russian. I've set up my DNS to point to the same IP as thermex.lv. Previously, ee and lt domains were pointed to the same hosting and had their own sites.
Symptoms:
When I tried saving those settings, I get a red error 'not valid' for each language.
Questions:
Do I need to change any hosting settings?
Hello!
The issue can be a false positive.
You can try and verify this by unchecking the validate checkbox and saving and if your site works just fine - it is probably that.
In addition, if you have static constants for WP_SITEURL or WP_HOME in your wp-config.php - this can also be the reason for the validation to not pass when you have different domain per language setup.
Yes, unchecking Validate box has helped to save settings, when changing language on the site now - redirect to another domain works.
However I'm getting "There has been a critical error on this website." error and I have a suspicion that this error I see is from the old website that was hosted on this space.
Just to clarify - on the server thermex.ee still has old website files and database.
What is the correct way of setting up the server for scenario where I already had old website running at thermex.ee?
Thermex.ee was working under php 7.4 and its failing on 8.3
New site, on thermex.lv works on 8.3. So prior to changing language config I configured all domains to php 8.3, which made old site on thermex.ee to fail, which was expected.
If I enable 7.4 on thermex.ee - I will get old site when trying to switch to Estonian language on thermex.ee
It seems there may be an issue with how your domain-per-language setup is configured.
There should not be separate websites running on the additional domains. When WPML is disabled, you should still be able to access each domain, and they should all correctly display the same main website (from the root folder).
If this isn’t happening, it's likely due to a misconfiguration in your DNS settings.
WPML’s role in this setup is simply to switch languages and serve the appropriate language content on each domain. However, even without WPML, all domains should resolve correctly and display the default language version of your site.
Once your domain configuration is working as expected, feel free to re-enable WPML. If you then encounter any issues, don’t hesitate to reach out — we’ll be happy to assist.
I deleted those domains from hosting account and created aliases for the main domain. Now all works as expected in terms of language switching.
The only problem we got - CORS issues that are usually complex to deal with. We have CloudFlare access and full hosting access. Site is running on Apache, we can also switch to Nginx
Could you please help us address it?
When loading thermexlt.lt I see this is the console
Access to font at 'hidden link' from origin 'hidden link' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
GET hidden link net::ERR_FAILED 200 (OK)
Access to font at 'hidden link' from origin 'hidden link' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.