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

Last updated by Yvette 1 month, 4 weeks ago.

Assigned support staff: Yvette.

Author Posts
August 1, 2019 at 3:05 pm #4323321

thomasS-128

Tell us what you are trying to do?
We are attempting to use the different domains by language option for our site, and are having trouble setting up the DNS properly (or perhaps it's another issue, we're not entirely sure)

Is there any documentation that you are following?
Your guide on the matter: https://wpml.org/2016/04/use-wpml-different-domains-per-language/
And many different support thread about this topic that did not resolve our specific problem

What is the link to your site?
dev.lafourmibionique.com

So, we have created an A record on the domain we wish to use as for a language (mercithomas.net) pointing to the server the WordPress installation is on:
hidden link

Then we added the domain as an additional domain on our cPanel, making sure that it is targeting the proper folder:
hidden link

However, the domain will not validate in WPML:
hidden link

Unchecking the validate box allows the settings to save, but when the language selector on our home page is clicked, and we are redirected to mercithomas.net, the page is blank (we were using different languages in directories beforehand, so all the content should exist on the second langauage).

Also, mercithomas.net lacks SSL, which may also be causing an issue. However removing the "s" from https on mercithomas.net only redirects us to the homepage of the company that the server is purchased from. It appears there is no easy was to get an SSL certificate for the domain on this server, as neither Let's Encrypt SSL or terminal access is given. (Our client's live site has SSL, however we were only handed this project recently and are unaware of how they achieved this before. Most likely opening a ticket with the server hosts and requesting it.)

Any idea what we're doing wrong?

Note: The domain (mercithomas.net) we are using for this is purely a test domain, and will not be the one used for our live version. This is all being done on a dev copy of our site. (dev.lafourmibionique.com)

August 2, 2019 at 6:45 am #4327255

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

To setup the URL domain-per-language format requires that the server settings be correct so that you can see the license.txt file equally from all of your domains:

e.g. hidden link
hidden link

This has everything to do with your server setup and is necessary before you even install/configure WPML.

Right now, I cannot visualise the license.txt from the 2nd domain - so please work with your server support to correct the DNS records so that it is possible. Every server does things their own way so we are not really able to help/advise you on this step.

From my experience, however, you usually want to define your additional domains as Alias domains (which may be the same thing as "add on" for your server environment - like I said, they all seem to have their own terminology and tools to achieve this).

Once you can visualise the license.txt file in all domains, then please write back if you are still having trouble completing the URL language format setup.

Thanks
PS. Sorry, but we cannot advise either on the ssl steps you need to do either.

August 9, 2019 at 9:34 pm #4373027

thomasS-128

Hi again, had a bit of a delay. It turns out our DNS problems were due to the clients hosting company. We've moved the dev site over to one of our servers to complete the testing of multiple domains and have properly validated the hidden link domain. It is now working successfully as a second language on the site. The new test site is hidden link.

However while the multiple domains is working, the site itself is having troubles. We are getting a ton of 404 and 406 errors on assets, jQuery seems to be having trouble loading up it's library, and plenty of Cross Origin Resource Sharing issue.

I've tried disabling plugins and activating debug mode, but nothing seems to stop all the errors. At times the site looks like it's working perfectly, but the developers console states otherwise with several 406/404 errors, and several important functions (such as "Add to cart" or "Select product option" buttons) are missing from the page.

August 12, 2019 at 7:37 am #4378891

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

Could it have something to do with the way you migrated the site to the new server?

Please provide system access details (wp-admin and ftp) in the private area that I am opening for you here.

August 13, 2019 at 10:31 am #4387045

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

I took a look at your site. I did see the 404/406 errors but they seemed to be relatd to images. So, I ran the Media Transaltion step and the errors have mostly disappeared.

You wrote: "..several important functions (such as "Add to cart" or "Select product option" buttons) are missing from the page..."

Where can I see this problem? On your store page in both langauges as well as on the single product template, I am seeing the expected buttons. Please provide a URL and screenshot where the buttons are missing.

August 13, 2019 at 4:16 pm #4389437

thomasS-128

Thankfully, it seems that the issue with the missing buttons has resolved itself for now. The attached images are what it looked like for me beforehand.

However, I've reactivated some plugins that we will require and it looks like some more errors (mostly from iframes that they previous designer decided to use) have appeared due to CORS issues. We're not sure how to modify this, is it due to the iframe itself, or do we change the CORS policy somehow?

August 14, 2019 at 8:52 am #4393595

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

I´ve done some research on konwn issues with CORS and WPML. The only recent problems reported have been with W3TC plugin.

What exactly is the nature of the message on your site?
Normally, I believe this to be out-of-scope for WPML and either has to do with the server settings or, as stated previously, some kind of caching.

August 14, 2019 at 8:27 pm #4397349

thomasS-128

Ok we're looking into the CORS/iframe issue to see what can be done.

There does still seem to be another issue however. Randomly, and often, a page will fail to load any resources at all. Or it will fail to load the main minified CSS file and admin-ajax.php. See images for details.

We've tried re-registering permalinks (without changes, just pressing save settings again), running the media files and link target translations/syncs from the WPML settings menu, re-saving pages, and disabling parts of our cache plugin (WP Rocket) or disabling it altogether. We are going to try disabling plugins one by one again, and reverting themes to one of the WordPress defaults, however our work day is almost over so we will have to get to that tomorrow.

Also, we've had WordPress debug mode active for the last few days, and these two errors keep appearing in the log file over and over again:
[14-Aug-2019 20:03:09 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'remove_default_stylesheet' not found or invalid function name in /home/mercbnnt/test.mercithomas.ca/wp-includes/class-wp-hook.php on line 286
[14-Aug-2019 20:03:09 UTC] PHP Notice: WC_Cart::get_cart_url is deprecated since version 2.5! Use wc_get_cart_url instead. in /home/mercbnnt/test.mercithomas.ca/wp-includes/functions.php on line 4435

Does debug mode conflict with plugins at all (in this case, WPML)?

August 16, 2019 at 6:30 am #4404849

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Helllo

1. Ramdom resource loading errors
You wrote: "... Randomly, and often, a page will fail to load any resources at all. Or it will fail to load the main minified CSS file and admin-ajax.php. ..."

Response: In my experience, if this is not happening "consistently" / "every time" you load a page, then it suggests a server setup issue and not a plugin one unless the plugin has to do with caching. I don´t think this is directly related to WPML plugins

2. Debug mode
No, I have not heard in any case that debug mode interferes with WPML plugins. Please also note that the "notifications" are not necessarily errors. They also don`t seem to be related to the WPML plugins.

The topic ‘[Closed] Different domains by language’ is closed to new replies.