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 thread is resolved. Here is a description of the problem and solution.

Problem: How can I set different domains per language?

Solution: To use different URLs/subdomains per language, please follow the documentation outlined here: https://wpml.org/2016/04/use-wpml-different-domains-per-language/

This topic contains 1 reply, has 2 voices.

Last updated by Lauren 1 year, 4 months ago.

Assigned support staff: Lauren.

Author Posts
May 21, 2018 at 5:50 am #2198839

lilianL-2

Hi

Our problem is two-fold, but first some background information.
We are using a custom theme template for the domain hidden link
All installations are up to date.

We are using the following plugins from WPML:
WPML Multilingual CMS
WPML String Translation
WPML Translation Management
WPML Media
Advanced Custom Fields Multilingual.

First problem:
We have a subdomain, hidden link
We are using the following code to display the page, which we put in an index.php file under the subdomains folder.
<?php
$_GET['page_id']=9279;
define('WP_USE_THEMES', true);
require('../../cluberiks.se/public_html/wp-blog-header.php');
?>

This code works wonderfully, however, when we turn on WPML CMS, it stops referring to the theme and plugin files through cluberiks.se/... and instead tries to refer to them through hurtigruten.cluberiks.se/... which breaks the page. Simply put, it does not load any js or css elements anymore that might be used on the page.

Strangely enough, image URLs are not broken, I assume It is because the database content still loads as it should.

How can we fix this?

Second problem:
We are trying to implement a norwegian translation through the domain hidden link, however, when we make a translated page and try to view it, it simply redirects back to hidden link
(We have followed the guide).

All and any help is much appritiated.

Currently, WPML Multilingual CMS is turned off, as it breaks the subdomain.

May 22, 2018 at 4:47 pm #2210451

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thank you for contacting WPML support. I'll be happy to help you with this.

To be honest, I'm not sure that WPML will work in these settings, at least not without requiring custom code. To use different URLs/subdomains per language, please follow the documentation outlined here: https://wpml.org/2016/04/use-wpml-different-domains-per-language/

If you have followed the guidelines on this documentation and the URLs are not directing correctly, then it is likely your custom code in the index.php file that is breaking the redirection. Per our support policy, I am unable to provide custom code solutions, but I can get you in touch with some WPML contractors who would likely be able to assist.

As for the redirect on hidden link, I think this is related to how you have registered and set up the different domains. Please reference documentation that I mentioned above. To test if it is the domain mapping issue, I suggest temporarily switching to different languages in directories or languages added as parameters to see where the redirect issue comes from. If you have issues with those URL formats, please temporarily deactivate non WPML plugins and switch to a default theme such as Twenty Seventeen to see if it works correctly in those settings.

Please let me know if you need any further assistance and I will be happy to help.