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

Last updated by Andrés 5 months ago.

Assigned support staff: Andrés.

Author Posts
May 13, 2019 at 8:03 am #3795873

magnusS-9

We have a client site where we are planning to use 4 languages and we have 4 different domains that we are trying to get to work together with WPML but i can't really figure out what's not working.

This is the error message that we get when trying to use the language/domain setting. Ideally i would like the site to serve the corresponding language that match the domain. If i go to siteurl.dk i would like to get the danish version of the page in question. Sounds simple in theory but apparently not 🙂

Unfortunately I cannot grant any third-party users access to the site due to client rules but i will try and provide as much information as possible.

This is the current state of my Apache2 host-file and i'm starting to think that i have done some mistakes here. Is this the proper way to setup a site in the way i describe?

- Both www and none www should be redirected to https://
- When i go to stihlacademy.no i want the site to serve me the Norwegian version of the page if it exists, otherwise serve the english version.

<VirtualHost *:80>
   ServerName siteurl.se
   Redirect Permanent / <em><u>hidden link</u></em>
</VirtualHost>

<VirtualHost *:80>
   ServerName siteurl.fi
   Redirect Permanent / <em><u>hidden link</u></em>
</VirtualHost>

<VirtualHost *:80>
   ServerName siteurl.no
   Redirect Permanent / <em><u>hidden link</u></em>
</VirtualHost>

<VirtualHost *:80>
   ServerName siteurl.dk
   Redirect Permanent / <em><u>hidden link</u></em>
</VirtualHost>

<VirtualHost *:443>
   ServerName siteurl.se
   ServerAlias <em><u>hidden link</u></em>
   DocumentRoot /var/www/html/sitedirectory
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
   SSLEngine on
   SSLCertificateFile /home/user/siteurl.se.pem
   SSLCertificateKeyFile /home/user/siteurl.se.key
   SSLCACertificateFile /home/user/intermediate.pem
   </VirtualHost>
   
<VirtualHost *:443>
   ServerName siteurl.fi
   ServerAlias <em><u>hidden link</u></em>
   DocumentRoot /var/www/html/sitedirectory
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
   SSLEngine on
   SSLCertificateFile /home/user/siteurl.fi.pem
   SSLCertificateKeyFile /home/user/siteurl.fi.key
   SSLCACertificateFile /home/user/intermediate.pem
</VirtualHost>

<VirtualHost *:443>
   ServerName siteurl.no
   ServerAlias <em><u>hidden link</u></em>
   DocumentRoot /var/www/html/sitedirectory
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
   SSLEngine on
   SSLCertificateFile /home/user/siteurl.no.pem
   SSLCertificateKeyFile /home/user/siteurl.no.key
   SSLCACertificateFile /home/user/intermediate.pem
</VirtualHost>

<VirtualHost *:443>
   ServerName siteurl.dk
   ServerAlias <em><u>hidden link</u></em>
   DocumentRoot /var/www/html/sitedirectory
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
   SSLEngine on
   SSLCertificateFile /home/user/siteurl.dk.pem
   SSLCertificateKeyFile /home/user/siteurl.dk.key
   SSLCACertificateFile /home/user/intermediate.pem
</VirtualHost>


<Directory /var/www/html/sitedirectory >
   Options Indexes FollowSymLinks MultiViews
   AllowOverride All
   Order allow,deny
   allow from all
</Directory>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Thank you for a great plugin 🙂

Hopefully someone could point me in the right direction here.

Best regards,
Emil

May 13, 2019 at 12:48 pm #3798345

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

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

Hello Emil,

Welcome to WPML support forum.

The idea behind of using this setting is that all your domains point to the same WordPress site without any redirection. One way to verify this is to deactivate WPML, once you do it, all your domains should display the same content (without any redireciton).

Once you achieve that, you can reactivate WPML and go to WPML > Languages and add your domains. If you are receiving a Not valid message, uncheck the checkbox and try to save them again.

If the initial configuration (server level) is working fine, this should work as well.

You can find more information about it here:
https://wpml.org/2016/04/use-wpml-different-domains-per-language/

Best regards,
Andrés

May 13, 2019 at 1:37 pm #3798867

magnusS-9

Hi!

Thank you for the reply.

I think i'm getting a bit closer now.. but it's still some issues left. Right now for example, all of my four domains work and i get the same page without any redirection, but only if i use "plain" as permalink structure.

I still get the "Not valid" message on 3/4 of my domains though. I have no idea why.

I did some tweaking in my virtual host file and it looks like this now instead:

<VirtualHost *:80>
    ServerName siteurl.se
    ServerAlias siteurl.fi siteurl.no siteurl.dk
    DocumentRoot /var/www/html/stihlsite
</Virtualhost>
May 13, 2019 at 1:40 pm #3798871

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

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

Perfect! As I mentioned before the validation option may fail as well, have you tried unchecking that option and saving your domains?

Regards

May 13, 2019 at 3:15 pm #3799861

magnusS-9

Yes i got it to work but only when using plain permalink structure and i got some strange redirections to to the default language even though i removed all the forwarding.

Is there any way to use the function together with post-name permalink structure?

May 13, 2019 at 3:56 pm #3800349

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

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

That shouldn't be an issue, if your domains are correctly configured, domains per language option should work. Probably you still need to check your cache and/or your server configuration, otherwise, we can check if there is an interaction with other plugin or your theme.

For verifying that, On your test site, please check if this issue appears when:
- Only WPML plugins are activated. It will tell us if there is an interaction issue with other plugin.
- Theme is set to a WordPress default like Twenty Fourteen. Its will tell us if there is an interaction issue with your theme.
- If the problem disappears, start activating one at the time to track where the incompatibility is produced.