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

Last updated by Andreas 1 year, 9 months ago.

Assisted by: Andreas.

Author Posts
February 10, 2023 at 5:54 pm #13009111

staffanS-2

I would just like to clarify something from my last c running hat so I'm not off doing something stupid.

We are running a multidomain site and have Redirect disabled. What happens if you type the domain for a site that is not your native language? It's always redirecting to buting.se

I guess your language is english, could you please try to go to hidden link (german site) and tell me what you see.

February 10, 2023 at 6:28 pm #13009197

staffanS-2

So I created a testing site at hidden link and deactivated wpml

February 10, 2023 at 6:34 pm #13009245

staffanS-2

I'm not really sure how this will help me, I can't really test the wpml multidomain function since it only takes me to the original site butong.se

February 10, 2023 at 7:28 pm #13009545

staffanS-2

So here's an idea why the site is doing the redirection. I have in the past changed the default language and then I'm not sure if I turned it back to Swedish or if WPML has done that by itself.

February 10, 2023 at 8:25 pm #13009705

Andreas

Hello there

Thank you for contacting us. I am happy to help you.

First of all, I would like to clarify that WPML is not able to do any kind of 301 redirections. The only thing it can do, if you enable it, is to set a cookie and display the proper language based on browser language, which is not your case.

Now from my search, I found that the Redirection is caused by Litespeed. Please check my attached images.

So I would suggest checking Litespeed and if it has some cache or defined some 301 redirect.

I hope this helps. Please let us know how it goes or if you need any further assistance. I'll gladly help you. 🙂

Regards,
Andreas

lite.png
February 12, 2023 at 6:55 am #13014277

staffanS-2

This issue has ween with us for quite som time and has been present with w3 total cache and Litespeed.

It is not a 301 redirection, if I understand the definition correctly, if you try hidden link it probably redirects you to hidden link since german is not your native language.

I also deactivated litespeed 2 days ago

You February 10, 2023 - 7:18 pm (a day ago)
Deactivated plugin "LiteSpeed Cache"
View plugin info

February 12, 2023 at 7:00 am #13014311

staffanS-2

Now I have also cleared the database with litespeed entrys with WP Optimize as well as other entries of not used/installed plugins. Still the same result.

February 13, 2023 at 9:56 am #13018549

Andreas

Thank you very much for your reply.

May I ask you to share the content of your .htacess file?

I am marking your next reply as private.

Regards,
Andreas

February 13, 2023 at 9:39 pm #13024749

staffanS-2

# BEGIN LSCACHE
# END LSCACHE
# BEGIN NON_LSCACHE
# END NON_LSCACHE
# fix CORS error for fonts
<FilesMatch ".(eot|otf|ttf|woff|woff2)">
Header always set Access-Control-Allow-Origin "*"
</FilesMatch>

#Begin Really Simple Security
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
RewriteRule ^(.*)$ hidden link{HTTP_HOST}/$1 [R=301,L]
</IfModule>

#End Really Simple Security
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

February 14, 2023 at 9:06 am #13027893

Andreas

Thank you

In your htaccess there is a 301 redirection based on {HTTP_HOST}.

May I ask you to check if this is what is causing you the error?

Regards,
Andreas

February 14, 2023 at 9:25 am #13028411

staffanS-2

So i cleaned the whole htaccess file, there's only comments in it now. Still same result. But I noticed a difference in how I write the links

hidden link takes me to butong.se

but
hidden link takes me to butong.fr

Can you see if you get the same results with and without www?

February 14, 2023 at 9:37 am #13028653

Andreas

First of all clear htacess is not the best idea, because WordPress needs some server rules in order to work.

I am not sure if you are familiar with htacess rules and if you do it in purpose.

Now redirection of www to non www domain is also can set with different ways. Not sure how to implement your server or site. But in general, have in mind that it is not bad this behavior.

The only thing I would like to know since you comment on the lines in htacess, may I ask you to check it again and see if for any reason new lines have been added there?

Regards,
Andreas

February 14, 2023 at 10:00 am #13028851

staffanS-2

The only thing still in the htaccess file is

# BEGIN LSCACHE
# END LSCACHE
# BEGIN NON_LSCACHE
# END NON_LSCACHE
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.

# END WordPress

The things in the file were generated by a removed plugin. But I have a backup of it just in case.

February 14, 2023 at 10:55 am #13029425

Andreas

Thank you this is the default htacess for WordPress

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

You can check it.

Regards,
Andreas

February 15, 2023 at 7:12 am #13035837

staffanS-2

I applied this htaccess to the site and it seem to keep the site intact, but still get the same redirect.