Skip Navigation

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 33 replies, has 3 voices.

Last updated by Sumit 4 years, 6 months ago.

Assigned support staff: Sumit.

Author Posts
April 26, 2016 at 10:02 am #869063

scottT-2

No, that doesn't help.

Like I said, the redirection comes from the PHP level, not from the server level. So the problem can't be anything to do with the DNS or server configuration. It's either WordPress or WPML.

I've already set up WPML as shown in the article you linked, as I'm sure you verified when looking at my testing server.

Like I said, I'm not at all surprised that with WPML disabled I'm redirected. Without WPML, as far as WordPress is concerned, the French domain is simply the wrong domain, and so of course it is right to redirect me to the only domain it recognizes as the correct one: the English one.

I'm going to ask on another forum. It could be a Trellis issue, or a misconfiguration in how I've set Trellis up. I'll report back.

April 26, 2016 at 12:22 pm #869223

Andrés
Supporter

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

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

While we wait for the your other forum results let's take another consideration:

I have installed Adminer plugin and took a look at your wp_options table. According to your settings there, I see that you don't have your WordPress installation in a root directory and it may related to an issue solved in the following link:
https://wpml.org/fr/forums/topic/le-selecteur-de-langue-envoi-dans-le-dossier-dinstallation-erreur-404/#post-865411

However, the expected behaviour for the domains per language option with WPML being deactivated is that both domains must show the same content with any redirection, but it worth to check it out.

I'll wait for your findings.
Regards,

April 27, 2016 at 2:04 am #869786

scottT-2

The settings you point to -- the wp subdirectory is where WordPress files are. This is part of Bedrock: hidden link
The application-specific files are next to that in an app directory.

Are you saying this is misconfigured? I tried removing the 'wp' suffix from both of the configuration options you pointed to, and it doesn't appear to have changed anything, though maybe a cache of some kind needs to be cleared.

Though which domain should be here? Obviously I can only add one of the default (English) or French domains.

As I said before, you can edit whatever you like on this server if you think it'll help.

April 27, 2016 at 8:08 am #869895

Andrés
Supporter

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

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

I'm sorry, I was misguided. I was comparing it with the WPML debug information of this thread that points to :
SiteURL hidden link
HomeURL hidden link
However this kind of installation is not the case for the site you have provided me access, so you don't need to modify it.

We publish an article yesterday about how to handle and setting your different domains when trying to use this option with WPML. Here you can find a more detail information about how to configure your DNS and make that your different domains point to the same WordPress installation.
https://wpml.org/2016/04/use-wpml-different-domains-per-language/

With this information, could you please verify that both domains are correctly configure? Deactivate WPML, both domains should show the same content without any redirection.

April 27, 2016 at 5:08 pm #870464

Andrés
Supporter

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

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

I'm not familiar with Nginx servers but maybe it is related to the use of 'UseCanonicalName'. I know this is an Apache setting but there should be an equivalent for Nginx servers.
In Apache, it is "Off" by default and it may interfere with using "A different domain per language" option when it is activated as you it may create redirections.
hidden link

Could you please verify this parameter?

April 27, 2016 at 8:21 pm #870624

scottT-2

OK, I've set those settings back to what they were.

As I've said a couple of times already, DNS is totally fine. Both domains point to the same site.

Regarding 'UseCanonicalName', there is no equivalent in nginx. Besides, as I've already said, the redirection is coming from PHP, not from the web server.

Can you reassign this to the second tier, please? Preferably someone in an American time zone rather than European, too.

April 28, 2016 at 8:48 am #870851

Andrés
Supporter

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

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

As I said, I'm not familiar with Nginx but it worth it to try 🙂

I still don't know how this redirection could be added by WPML from the PHP code, if it is deactivated. However, I feel it is a grey zone, so let's give the opportunity to intervene to one of our 2nd Tiers as they may have better luck and see something we don't. He is going to be assigned randomly, so I can't guarantee you anything about that.

In the meantime, could you please upgrade your WPML package to 3.3.8 version ?

Regards

April 28, 2016 at 8:14 pm #871583

scottT-2

You misunderstand. I'm not saying WPML is *adding* the redirection; obviously it's not, since with WPML disabled we still get the redirection. I'm saying I think WPML should be *disabling* this redirection.

I've updated WordPress and WPML.

April 29, 2016 at 9:40 am #871880

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Scott,

I am Sumit from 2nd tier support.

You are right about that WordPress redirect to home url if some another domain point to same directory and WPML prevents it thus display the secondary language content. But only with standard WordPress installation.

It seems to me you've customized a lot of things.
#1 wp-config.php and index.php in root directory (That's okay)
#2 Rest of the WordPress in sub directory (That's okay)
#3 wp-config.php loading external libraries (Not okay)
#4 WordPress constant defined in external hidden file (Not okay)
#5 plugin directory is not on default location but plugins folder exist and where you've defined it I did not find it (Not okay).
#6 If I remove constant site_url and home_url from that hidden file the site become dead screen not sure why (Not okay)

I tried to setup with standard configuration in wp-config.php but I did not find password for your db user. The hidden file which contain all of the information does not contain db password.

The key thing, I am able to setup your site in my local server with index.php and wp-config.php in root directory and rest of the WordPress in sub directory with WPML + language per domain and it works perfectly.

Would you mind to do the same? Can you please test it with standard configuration file and removing all of the customization which have been done?

Thanks

April 29, 2016 at 10:20 am #871916

scottT-2

No, that's too much. What I'm using is pretty much a stock Roots Trellis/Bedrock installation. See hidden link

I made none of the customizations you mention myself; it's all from Trellis/Bedrock.

All the constants you were looking for are in the file /srv/www/ceso-saco.com/current/.env and as I think you found they're loaded into WordPress via configuration files in /srv/www/ceso-saco.com/current/config

You say you found that hidden file with the constants, but I guess you didn't look in it hard enough, because the DB password is definitely in there. Line 12.

I'm not sure what you're asking regarding plugins. They're installed via composer into /srv/www/ceso-saco.com/current/web/app/plugins

April 29, 2016 at 1:42 pm #872139

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Scott,

Thanks for the information. Yes somehow I missed that db password. Now I tested the site by removing Roots installation for a while. And issue persist.

Well we can reproduce this on clean install only with Nginx server. With following conditions
#1 Redirect only occur for root domain not for internal pages.
#2 If you will remove the front-page from settings it does not redirect.

I've forwarded this issue to 3rd tier. I will let you know as soon as I've some feedback.

Thank you for your patient.

April 30, 2016 at 3:12 am #872446

scottT-2

Thanks.

May 3, 2016 at 6:27 am #873733

scottT-2

Though I should point out again that the unwanted redirection to the primary language does happen on internal pages too. It happens on whichever page is set as the "home" page in WordPress settings, and not on any other pages. Can you reproduce that?

May 10, 2016 at 9:59 pm #879689

scottT-2

I'm spinning down the testing server. If you can indeed reproduce on your end, please let me know if/when you come up with a solution.

May 10, 2016 at 11:37 pm #879709

scottT-2

It looks like this might have actually been fixed in WPML 3.3.8, but I have a new issue which I'm not sure is related so I'll open a new ticket.

I'll leave this one open until I'm sure it's fixed, after the other issue is resolved.

The topic ‘[Closed] On home page (only), always redirected from French to English’ is closed to new replies.