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

Last updated by Shekhar Bhandari 1 year ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
September 27, 2018 at 2:29 am #2769101

antonioI

Referring to this article https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/

It says I can set domains and subdomains for each language, is it possible to set a mix of domains and subdomains? For example site.com (english), it.site.com (italian), site.fr (french), and so on? Or it has to be ALL domains or ALL subdomains?

I assume it should be possible as they would all be absolute paths.

If it is not possible, I would kindly ask if this could be added as a new feature. Sometimes you want to add translations for many languages, but you don't want to register all domains as you want to focus on some countries more than others. On those have the local domains, and not on the others. If using a mix of domains/subdomains is not possible then you're forced to use all domains or nothing.

September 27, 2018 at 2:46 am #2769208

antonioI

Here I am going to explain more in details.

I have 5 languages, WordPress is created under the .com website. My best choice would be to keep everything under .com, then use the .pl domain for the polish language, and use subdomains for the other languages.

If that is not possible, how can I still keep everything under .com and also have the .pl that shows content from .com/pl but still has independent .pl url?

I have setup the .pl domain to redirect to .com/pl, so okay, visitors typing .pl arrive to the correct language.

RewriteCond %{HTTP_HOST} ^site\.pl$ [OR]
RewriteCond %{HTTP_HOST} ^www\.site\.pl$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^/?$ "http\:\/\/site\.com\/pl" [R=301,L]

But I want visitors that arrive to that page to see the .pl in the url.

So maybe I would need another RewriteRule, perhaps with {REQUEST_URI} attached, so that after first redirection .pl to .com/pl, the url rewrites to be .pl and adjust to any .pl/inner-page

If that works, and if redirections can be subsequential, which I am not aware about.

Could you please write the rule that I should use? Or any other idea?

The option of the wpml plugin would make me achieve my goal, but if I have to have all domains, and I don't, I would need to decide if I want to have all languages, or delete the extra languages in order to have the single .pl domain. Which is why of the proposed workaround.

Thanks

September 28, 2018 at 2:48 am #2772375

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thank you for contacting WPML support. I'd be happy to assist you further on this issue.

You can use the local subdomains and domains at the same time for the languages installed in WPML, but you should make sure that all the subdomains and the different domain are an alias of the main domain.

You can know more about how to setup it here or you can consult your hosting partner for this, as this settings can be different on your hosting.
https://wpml.org/2016/04/use-wpml-different-domains-per-language/

Look forward to your reply.

Thanks

October 3, 2018 at 12:24 am #2783022

antonioI

I cannot get this to work:
-My main domain is site.com, I am trying to use site.pl for polish and de.site.com for german, or in general a mix of local domains and subdomains for the additional languages
-I have a shared server on namecheap with cpanel
-the guide is totally not clear
-I need to point site.pl with A record, okay, that is clear. And it is being added as alias.
-The guide mentions subdomains and aliases, which one should I create in order to have de.site.com?
-The guide mentions that I need to point aliases (or subdomains?) to the main WP folder installation. It is only possible to point subdomains to the WP folder. When creating aliases they can only point to public_html and my site is already in a subfolder of that, as it was added as Add-On domain to my server.
-When I save the settings "WPML -> Languages to Different domain per language" in WPML plugin and "Validate on Save" is ticked, it gives error and doesn't save the settings. If I uncheck "Validate on Save" it saves the settings with the subdomains but the subdomains don't load anything when typing the url.
-The part of guide "Setting up your HTTP server" I couldn't follow as I don't have access to httpd.conf. Or anyway it doesn't mention where to add those codes. The guide is also not clear if when using cPanel that part of configuration is needed.
-If I add the Debugging lines to wp-config.php nothing happens, I tried to re-save all settings in order to force to generate errors but the /wp-content/debug.log still is not created and nothing works.

Can I please get some serious help with this?

October 3, 2018 at 3:05 am #2783460

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

The guide mentions subdomains and aliases, which one should I create in order to have de.site.com?

- create subdomains first
- then set the subdomains as aliases

The guide mentions that I need to point aliases (or subdomains?) to the main WP folder installation.

Exactly, but this means that it needs to point to the same folder where the main site is installed if it's installed in a subfolder you need to point the subdomains to the same folder.

The part of the guide "Setting up your HTTP server" I couldn't follow as I don't have access to httpd.conf. Or anyway it doesn't mention where to add those codes. The guide is also not clear if when using cPanel that part of the configuration is needed.

Did you consult your host about creating this alias of domains? As I previously mentioned the server settings can be different from each hosting provider, so it's better to ask them how to do this once. Could you please ask them host to create subdomains and make an alias of the default site and perform those steps properly?

Once these steps are done, the domains will be validated properly.

Let me know if this helps.

Thanks

October 3, 2018 at 4:26 am #2783494

antonioI

-How do I create an alias from a subdomain in cPanel? When I try to add de.site.com as alias, while it is already created as subdomain, I receive error: The domain already exists in the Apache configuration.
-Do I need to point the subdomain OR the alias to the subfolder? In cPanel I can only point the subdomain to a subfolder. For the aliases there's no option to do that and they can only point to public_html.
-I tried with hosting support in chat for 2 hours, I provided them the link you provided but they don't really understand the steps. So I am trying to understand from the above what I can do in cPanel myself.

Then trying to understand exactly what to ask to them. As you said to ask
-"creating this alias of domains"? I guess you mean subdomains, and they will tell me it's not possible in cPanel, as I explained above.
-"ask them how to do this once" They don't really understand the guide as it's a mess of mentioning domains and subdomains. You can imaging how easy it can be for a regular support guy on chat to follow that guide.
-"ask them host to create subdomains and make an alias of the default site". Subdomains are created. I thought you mentioned to make aliases of the subdomains, now you're saying to ask them to make an alias of the default site? If I don't know exactly what to ask,they won't understand anything from the guide. I know because I was on chat with them for 2 hours already with no results.

October 3, 2018 at 5:39 am #2783520

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I am sorry if it was confusing, let me explain this to you further.

Let's take the example of the following:
site.com ==> English domain, Main domain
it.site.com ==> Italian (Subdomain)
site.fr ==> French domain (different domain)

Step 1:
Create site.fr an alias of site.com (you can use the parked domain option for this)

Step 2:
Create it.site.com subdomain, make sure the domain points out to the same WordPress Installation folder site.com is loading.

Step 3:
As a check, check if all the sites are loading the same content.

Step 4:
Add them to the languages URL format.

If you still don't get the site configured, you can ask the hosting service the following question


I have my site structure like below currently
site.com ==> English domain, Main domain
it.site.com ==> Italian (Subdomain)
site.fr ==> French domain (different domain)

Now what I want is to point every domain to a single WordPress Installation file (Same host IP address) and display the same content as the main site.

Let me know if this helps.

Thanks