Please make sure to update to WPML 4.3.4 before reporting any issue

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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 thread is resolved. Here is a description of the problem and solution.

Problem:
Redirects with trailing slash not working with Yoast SEO
Solution:
Change:

if ( $redirection['origin'] === $url || '/' . $redirection['origin'] === $url ){

to

if ( $redirection['origin'] === $url || '/' . $redirection['origin'] === $url || $redirection['origin'] . '/' === $url || '/' . $redirection['origin'] . '/' === $url ){

within the file and on line 15:

/sitepress-multilingual-cms/classes/compatibility/wpseo/class-wpml-wpseo-redirection.php

It is only a suggested workaround, but not tested much hence not confirmed (it has been confirmed to work for some clients though).

Tagged: 

This topic contains 12 replies, has 2 voices.

Last updated by lucM-5 9 months, 1 week ago.

Assigned support staff: Bruno Kos.

Author Posts
February 6, 2019 at 12:03 pm #3165369

lucM-5

I am trying to: get information on the status of this open support ticket https://wpml.org/forums/topic/redirects-with-trailing-slash-not-working/

I've been waiting for months now, and still no sign of life from your side.

I expected to see: this solved

Instead, I got: nothing but empty promises

February 7, 2019 at 8:58 am #3169173

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML support!

I've checked your previous thread and checked the state of escalated tickets within our internal system. The bug has been identified and I have asked our product lead on what is the status of this, so that I could at least give you (if possible) some rough estimate.

As soon as I get any information from them, I will update this ticket at once. There have been no news within our internal tracking system since you last talked with our supporter Bigul.

Regards,
Bruno Kos

February 7, 2019 at 10:27 am #3169608

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML support!

Based on the information I have just received from our product lead, there is no specific date on when is this going to be addressed.

In any case, as soon as I get any further information, I will update this ticket at once.

Regards,
Bruno Kos

February 7, 2019 at 10:31 am #3169617

lucM-5

Hi Bruno,

unfortunately, that's the only answer that is of no value to me.

Either your development will plan to work on it, and has at least an idea on when to do this. In that case, I can wait for a solution.

Or your development does not plan to work on it, and then I know I need to use an alternative multilanguage solution for the websites I will build in future.

If there is no specific data that can given by your development team, I conclude that it doesn't plan to work on it and that I have to proceed according to the second option above.

Greetings,
Luc

February 7, 2019 at 11:07 am #3169770

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

I wish I had better news for you at this point - this also relates with our https://wpml.org/purchase/support-policy/, especially the part with:

Fix Bugs in WPML:

"This one may sound strange, but it’s true. If you find a bug in WPML, we take it very seriously. We’ll add it to the bug-fix queue and work on it. However, we can’t fix everything right that minute. So, if you hit a bug that’s keeping you from doing something, we can’t promise that we’ll fix it right away.

We’ll work with you to find a sensible temporary solution and will let you know as soon as it’s fixed, but we can’t guarantee any schedule."

Regards,
Bruno Kos

February 7, 2019 at 11:11 am #3169773

lucM-5

Bruno

I do understand that. But this is definitely not a matter of "fixing it right this minute". This issue was reported 6 months ago, and has been acknowledged to be a bug. For 5 months, I haven't got any feedback at all - except for the message that it will be fixed but nobody knows when.

I hope you understand my point. I believe I have been very patient in this, but my patience is really coming to an end. I hope you understand that after waiting for more than 5 months, this is no longer a matter of "expecting a fix right away".

Luc

February 7, 2019 at 12:44 pm #3170217

Bruno Kos
Supporter

Languages: English (English )

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

Hi Luc,

I can totally understand that you can't wait any longer. You've purchased a product which should be doing something you need and if it doesn't do that, then it is completely understandable if you want to more forward.

On a side note, I am not sure if you tried this or if it makes any difference in your setup:
https://wpml.org/forums/topic/yoast-redirections-with-urls-ending-by-a-are-broken-by-wpml/#post-3150454

So removing the slash "/" at the end of the URL.

Regards,
Bruno Kos

February 7, 2019 at 12:47 pm #3170226

lucM-5

Bruno,

I do that whenever I can. With manual links, it is easy. With redirects defined by Yoast SEO, the trailing slash is always there. That's the specific issue that I reported. The only way to solve is to disable WPML. In that case all Yoast SEO redirect work fine, but of course the multilanguage behavior of the site is gone as well.

Luc

February 7, 2019 at 1:39 pm #3170479

Bruno Kos
Supporter

Languages: English (English )

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

Hi Luc,

I see - in that case, there's nothing else I can suggest at this point. 🙁

Regards,
Bruno Kos

February 13, 2019 at 11:13 am #3193531

Bruno Kos
Supporter

Languages: English (English )

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

Hi Luc,

Can you tell me the following - if changing:

if ( $redirection['origin'] === $url || '/' . $redirection['origin'] === $url ){

to

if ( $redirection['origin'] === $url || '/' . $redirection['origin'] === $url || $redirection['origin'] . '/' === $url || '/' . $redirection['origin'] . '/' === $url ){

within the file and on line 15:

/sitepress-multilingual-cms/classes/compatibility/wpseo/class-wpml-wpseo-redirection.php

works for you? It is only a suggested workaround, but not tested much hence not confirmed (it has been confirmed to work for some clients though).

Regards,
Bruno Kos

February 13, 2019 at 1:35 pm #3194253

lucM-5

Hi Bruno,

I really appreciate your feedback.

And guess what? This seems to solve the issue on the testing site where I introduced this change 🙂

That being said, how can we make this into an "official" fix that doesn't get overwritten by a future update of WPML?

Once again, many thanks for your persistence.

Looking forward to read your reply
Luc

February 13, 2019 at 2:29 pm #3194641

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Now there's some great news! 🙂

That being said, how can we make this into an "official" fix that doesn't get overwritten by a future update of WPML?

As for this, this is not up to me. Developers and product leads are to decide this and I am not in the position to "push" them in any way if you know what I mean. They decide this based on multiple factors such as:

- how many clients it affects
- is it breaking some WPML core functionality
- current development priorities
- etc.

Even if this works for you, it would have to go through very thorough testing before being published.

I know that this can be relative in practice because if we have only 1 client having a particular issue, it can be show stopper for them and totally irrelevant for all the other clients.

Therefore, I would suggest this:
- we close this ticket and mark it as resolved
- whenever there's an update for WPML, repeat the process above (sorry if that's troublesome for you, but I have no other suggestions)

I am following our internal tickets related to this issue and the very minute they post an update there, we (supporters) also reach out to all the clients affected with these issues and update these tickets.

Let me know how you want to proceed!

Regards,
Bruno Kos

February 13, 2019 at 2:45 pm #3194744

lucM-5

My issue is resolved now. Thank you!