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

Last updated by claudeD-2 1 year, 7 months ago.

Assisted by: Andreas W..

Author Posts
September 13, 2023 at 6:49 pm #14392309

claudeD-2

I am trying to:
Login with a site that use different domain per language and I get a redirection problem

Link to a page where the issue can be seen:
hidden link

I expected to see:
The admin page of WP

Instead, I got:
The URL hidden link and a page that indicate that I have a redirection problem. In reality I'm logged in. So if I go to the hidden link then I can click on the Dashboard link to access the backend at hidden link

If I deactivate " Auto sign-in and sign-out users from all domains" then the problem goes away, but I can't access the other language version.

September 13, 2023 at 6:53 pm #14392357

claudeD-2

Just to add that I've tried different browsers and also a screen cap of the too many redirects error message...

Capture d’écran, le 2023-09-13 à 14.51.41.png
September 13, 2023 at 7:08 pm #14392411

claudeD-2

Also to add that I tried deactivating every other plugins and resetting the permalinks with the same result.

September 15, 2023 at 2:53 pm #14404023

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

This might be an issue related to the htaccess file.

I would like to offer to have a closer look at the problem and request temporary access (wp-admin and FTP) to the website to investigate this issue further.

You can find the required fields below the comment section when you log in to leave the next reply. The information you provide is private, which means only you and I can see and access it.

IMPORTANT
Please be sure to make a backup copy of the website and database before allowing us access.
If you can't see the wp-admin / FTP fields, your post and website credentials are set as PUBLIC. DO NOT publish the data unless you see the required wp-admin / FTP fields.

The private response form looks like this:
hidden link

Next time you reply, click "I still need assistance."

Video:
hidden link

Please note that we are obliged to request this information individually on each ticket. We may not access any access information not specifically submitted on this ticket in the private response form.

Best regards
Andreas

September 15, 2023 at 3:43 pm #14404393

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

There are some custom redirect rules inside the htaccess file about which I am not sure, why they are there. Could you please consult your hosting support about this:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} on [OR]
RewriteCond %{SERVER_PORT} ^443$ [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} https
RewriteRule .* - [E=WPR_SSL:-https]
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* - [E=WPR_ENC:_gzip]
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{QUERY_STRING} =""
RewriteCond %{HTTP:Cookie} !(wordpress_logged_in_.+|wp-postpass_|wptouch_switch_toggle|comment_author_|comment_author_email_) [NC]
RewriteCond %{REQUEST_URI} !^(/je-signe/organismes/|/je-signe/je-signe-individu/|/je-signe/organismes-signataires/|/je-signe/citoyens-signataires/|/(?:.+/)?feed(?:/(?:.+/?)?)?$|/(?:.+/)?embed/)$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^(facebookexternalhit|WhatsApp).* [NC]
RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/wp-rocket/%{HTTP_HOST}%{REQUEST_URI}/index%{ENV:WPR_SSL}%{ENV:WPR_WEBP}.html%{ENV:WPR_ENC}" -f
RewriteRule .* "/wp-content/cache/wp-rocket/%{HTTP_HOST}%{REQUEST_URI}/index%{ENV:WPR_SSL}%{ENV:WPR_WEBP}.html%{ENV:WPR_ENC}" [L]

Further, do you think we could disable WPML for a minute on your site in order to test if this issue is in fact WPML WPML-related?

Best regards
Andreas

September 15, 2023 at 4:26 pm #14404533

claudeD-2

I don’t see what these are in the htaccess. You could comment them out to see the impact and just keep the minimal WP lines. You can also test deactivating WPML, although I‘be tried tried that and it solved the problem. Same if I deactivate the option to log in out of all domains in wpml.
Note that I’m on the road with limited Internet access.

September 15, 2023 at 5:11 pm #14404857

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I created a copy of the .htaccess file and tested it with a basic default .htaccess file,

https://wordpress.org/documentation/article/htaccess/

This did not solve the issue and I reverted the changes.

---

The issue disappears once I disable the option "Auto sign-in and sign-out users from all domains", which adds the following parameter inside the URL when logging out:

wpml_sso_token

So I connected to the database to check the WordPress Options table and I found some transients that refer to this option.

I am not sure what is expected here, as there seem to be two SSO sessions on the DB.

I suggest that we try to remove those transients from the database and test if this solves the issue or escalate the issue internally without taking any further changes.

If you would like me to give it a try by removing those translations from the WordPress Options table, please take a backup of the database and then let me know when you are ready.

Best regards
Andreas

transients.jpg
September 15, 2023 at 5:41 pm #14405055

claudeD-2

You can go ahead, I’ve done a backup with UpDraftplus.

September 15, 2023 at 6:03 pm #14405147

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you!

It appears as if deleting those transients solves the issue, but once I access /wp-admin from the second domain the issue occurs again.

I will need to take a copy of the site for testing it on a virtual server and then take further internal steps.

I would like to ask you for some patience on this matter.

In the meantime, I suggest you disable the option "Auto sign-in and sign-out users from all domains" - this way users will have to log in manually if they want to access wp-admin from the second domain.

Best regards
Andreas

September 15, 2023 at 8:49 pm #14405483

claudeD-2

Thank you, keep me posted on the progress of the resolution of this problem. I will do as you suggested and inform my client.
Have a great weekend
C

September 16, 2023 at 8:03 pm #14407123

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I have tested with an identical copy of your website on localhost while using different domains per language with Apache, PHP 8.2.10, and MariaDB 10.4.10 and I can not confirm the the issue here.

This means that this behavior is related to your server.

Have you already consulted the hosting support about this issue?

Please tell them that your site is having issues with redirects when using an auto-login function on a different domain.

Maybe there are too many redirects active on your hosting panel?

Best regards
Andreas

September 16, 2023 at 9:16 pm #14407163

claudeD-2

This cPanel is running on a VPS server and there are no redirection in this account. Still I have opened a ticket with my VPS supplier and I'll get back to you with their answer. Do you want an access to the cPanel to see by yourself ?

September 16, 2023 at 10:45 pm #14407197

claudeD-2

We realized that it is ModSecurity that caused this :

ModSecurity: Warning. Operator GE matched 4 at TX:outgoing_points. [file "https://cdn.wpml.org/etc/apache2/conf.d/modsec_vendor_configs/comodo_apache/20_Outgoing_FiltersEnd.conf"] [line "38"] [id "214940"] [rev "2"] [msg "COMODO WAF: Outbound Points Exceeded| Total Points: 4|declarationmontreal-iaresponsable.com|F|2"] [severity "CRITICAL"] [tag "CWAF"] [tag "FiltersEnd"] [hostname "declarationmontreal-iaresponsable.com"] [uri "/index.php"] [unique_id "ZQHZH6DmLil_gHxjdhhxAwAAjxQ"], referer: hidden link

September 18, 2023 at 4:35 pm #14414181

claudeD-2

I just want to add that we had a second ModSecurity rule that was causing the problem : 214540. Now it is solved completely.