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.

Tagged: 

This topic contains 12 replies, has 2 voices.

Last updated by BlogAdmin 1 month, 3 weeks ago.

Assigned support staff: Lauren.

Author Posts
August 21, 2019 at 7:13 pm #4434795

BlogAdmin

You closed the ticket here:

https://wpml.org/forums/topic/language-code-directory-links-without-trailing-slash-are-not-redirecting-properl/

Without providing me any opportunity to respond. I also can't see your response to the ticket.

August 21, 2019 at 8:03 pm #4434879

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

I have sent you a previous private reply. Please let me know once the migration is completed and hopefully we can reproduce the issue there and continue troubleshooting. Thanks for your assistance.

August 22, 2019 at 12:12 pm #4439183

BlogAdmin

The migration is underway. Will post an update once it's complete.

August 22, 2019 at 12:41 pm #4439459

BlogAdmin

Hi Lauren, so the window closed inadvertently and I can't tell if the migration is still going or is incomplete. Let me know if you see anything. I will send an update if I get an email that it's complete.

August 22, 2019 at 1:29 pm #4439729

BlogAdmin

Okay just got a confirmation that this is complete at Cloudways.

August 22, 2019 at 6:26 pm #4442205

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thanks for letting me know. I had to adjust some plugins because the site would not allow me to login. So on the test site, you can see some plugins disabled because it was breaking the site. I also replaced the .htaccess with the standard WordPress .htacces.

With the current settings, if you disable the "Disable URL Autocorrect Guessing" plugin, when you load
hidden link
you are redirected to
hidden link

If you then enable "disable URL Autocorrect Guessing", when you load
hidden link
you are correctly taken to a 404 page.

So, as assumed, it seems as though the culprit is WordPress' autocorrecting the URL. You may need to load the URL in an incognito browser to see the same results. Please let me know if this is what you see as well.

Thanks!

August 22, 2019 at 7:00 pm #4442335

BlogAdmin

This doesn't happen for me on production, with Disable URL Autocorrect Guessing enabled. Would you like credentials to the production website so you can see if there is a difference?

August 22, 2019 at 7:24 pm #4442461

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

No, I don't need credentials. You are able to see it working correctly on the staging site, right?

Please check the plugins that I had to disable on the staging site. Can you please disable these same plugins on the live site? I also remembered that I had to deactivate your theme in order to access the test site. Please also test this on the live site.The staging site has Twenty Nineteen active.

I'd like to get the live site matching the staging site as closely as possible to try and narrow down what could be the cause.

If all plugins/themes/settings match and it is still happening, you will need to get in touch with the hosting provider to check the server environment, since that would be the only difference left after checking everything else.

Thanks,
Lauren

August 23, 2019 at 12:09 pm #4446723

BlogAdmin

Hi Lauren, I do see the proper behavior on your staging, which rules out the data itself as being the issue. I'm trying to test a variety of things vs. your staging on our production site; first matching up each plugin, then combing through the theme to see if it's doing anything to permalink structures. If you can please keep the cloudways staging up over the weekend that would be great because it provides me a baseline to test against.

August 23, 2019 at 1:32 pm #4447647

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Absolutely! I will keep that test site up as long as you need. Let me know if you need anything from my end while you are testing.

August 25, 2019 at 7:01 am #4453315

BlogAdmin

I found the culprit: WP SEO by Yoast.

Apparently, the premium tool has a feature similar to one in the Redirection plugin; it detects changes in permalinks and creates redirects automatically. Somehow, it created redirects for each language /it/, /ja/, and so on, and set them to redirect to the posts we were seeing. I don't know how users triggered this to occur, but I'm guessing their modifying the permalinks of those posts resulted in those redirects.

This also explains why I didn't see this happening locally; on my local machine, I don't have those redirects because my data set is different.

So I've gone ahead and turned off WP SEO by Yoast's redirection module and all is working; /ja redirects to /ja/ because WP autocorrects it now.

August 25, 2019 at 7:01 am #4453317

BlogAdmin

(Thank you for your patience!)

August 25, 2019 at 7:02 am #4453319

BlogAdmin

My issue is resolved now. Thank you!