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 topic contains 6 replies, has 3 voices.

Last updated by fabriceT-2 3 years, 6 months ago.

Assigned support staff: Nigel.

Author Posts
April 8, 2016 at 6:10 am #856413

clausuleB

I have a question about the implications for changing from a different directory per language to a different domain per language.

Currently I have four languages set up:

hidden link
hidden link
hidden link
hidden link

I want to use a different domain for each language. How do I redirect all my URLs to the new domains? I'm worried about heaps of 404s in GWT.

Note: besides a country specific extension, the new domains will also have a different domain name as I'm currently using

April 8, 2016 at 8:56 am #856564

Nigel
Supporter

Languages: English (English )

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

Hi Clausule

Thanks for contacting us.

When WPML to use different domains for alternate languages, it makes no difference whether you use different subdomains (de.mydomain.com, fr.mydomain.com) or entirely different domains (mydomain.fr, mydomain.de), the process is the same.

It requires you to adjust your DNS settings and your server settings. We have a guide on how to do this here: https://wpml.org/faq/server-setting-for-languages-in-different-domains/

WPML will handle the switch-over from directory-based to domain-based language settings, but you should make a back-up before making the change just in case something goes wrong.

I noticed you linked to a google document (hidden link) about multilingual sites in another thread. My own interpretation of that document is that it may be helpful to switch to different domains if you are targeting specific regions (e.g. use 'fr' to target users in France rather than French-speaking users), but that it is not necessary for SEO purposes to switch from language in directories if you are simply targeting different users by their language.

I hope this helps.

Regards

Nigel

April 8, 2016 at 9:18 am #856587

clausuleB

Hi Nigel,

Thanks for the quick reply.

Please note that I'm referring to sub folders rather than sub directories for my current setup.

My question is about possible 404 errors because many URLs of my current setup have been indexed by Google. For example:

Currently: hidden link
New: hidden link

When I change to the new setup the current URL won't be available anymore right? This would mean Google cannot crawl it anymore and therefore a 404 error will occur.

If this is the case, then I should prevent this with a 301 redirect? And if so, how to do this?

April 8, 2016 at 10:54 am #856690

Nigel
Supporter

Languages: English (English )

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

Hello again Clausule

You're right that your inbound links will break if you change the url structure for your languages unless you take specific steps to preserve them with 301 redirects.

Ordinarily that would involve configuring your server to handle the redirects or editing your .htaccess file to do so, which is not trivial.

There is a WordPress plugin called Simple 301 Redirects that can make the task easier which is available from the WordPress plugin directory here: http://wordpress.org/plugins/simple-301-redirects/

You should of course have up-to-date backups beforehand, and it is advisable to test on a dev server rather than your live site.

Good luck.

Regards

Nigel

April 8, 2016 at 11:39 am #856732

clausuleB

Hi Nigel,

This plugin needs the old page to be still online so it can add the re-direct code to it. If I change from sub folder to different domain per language, will the old pages stay on the server at locations based on sub folder configuration?

April 8, 2016 at 2:21 pm #856901

Nigel
Supporter

Languages: English (English )

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

Hello again

I haven't used the plugin (or alternatives such as https://wordpress.org/plugins/redirection/) myself.

But you should be able to setup your redirects at any time.

When using a CMS like WordPress the only sense in which the pages exist at a particular URL is because the routing component of WordPress identifies what content to build a page from based upon the target URL and your permalink settings.

The way these plugins work is to tell WordPress to return a 301 redirect when someone (including google) tries to access the URLs that you specify. You need to tell the plugin what URLs to intercept and where to redirect them to, and you can do that whenever.

But, I repeat, I haven't used the plugins myself.

An alternative would be to intercept the URLs at the server level before they even reach WordPress, by editing the .htaccess file and including your rewrite rules there. If that is something you are comfortable with, there is a tool to help you generate your .htaccess rules which you might find helpful:

hidden link

Good luck.

Nigel

May 11, 2019 at 11:17 pm #3791513

fabriceT-2

Dear ClausuleB and Nigel,
I am writing you since i am going to use different domain per language.
I am asking myself the same question about the effect of switching the domain and the effect on page ranking.

How was your experience ClausuleB? Did you feel any changes in your site ranking?

What about SSL certificate? How did you handle?

I think to switch to different different domain before posting too many pages.

Thank you in advance for your advice.

Thank you,
Fabrice