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

Last updated by Laura 2 months, 1 week ago.

Assigned support staff: Laura.

Author Posts
August 2, 2019 at 8:21 am #4328011

michaelL-5

I have the Yoast plugin for WPML installed, but when it comes to adding redirects it is not possible to add a redirect for one language only. (Or, alternatively, to have a single path redirect to different places for the different languages.)

Example of what I want to do:
LANGUAGE 1: want /contact to go to /contact-page
LANGUAGE 2: want /contact to go to /contact-slug-for-the-second-language

It seems the redirects are not translatable, so when you change languages all of the redirects persist. You cannot set redirects by language...

In my case the site uses subdomains for the different languages, as opposed to the directory structure (which would make this easier to solve since the language is included in the relative path.) If I try to specify an absolute url for the redirect (since it would be required to identify which language I am wanting to redirect), I get this error:

"The old URL for your redirect is not relative. Only the new URL is allowed to be absolute. Make sure to provide a relative old URL."

I have not provided debug info, as this is more of a needed feature than a bug. However, I am wondering if this may have come up previously that you have a suggested fix.

Thank you in advance!

August 4, 2019 at 12:10 am #4335071

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+02:00)

Hi,

thanks for contacting us.

I didn't find any similar cases, so at the moment I don't have any suggestion.

Did you actually tested that adding a relative URL triggers the redirection to all languages instead of only one?

Also, are you using our plugin Yoast Multilingual?

I'll try to reproduce the issue on a fresh install so we can eventually escalate to the Developers' team.

August 5, 2019 at 8:09 am #4338929

michaelL-5

Hi Laura,

Thanks for the reply. And yes, we did test that the redirect applies to all languages. Also if you switch languages and go in and edit the Yoast redirect, your change applies to all languages as well.

And yep, I have the Yoast Multilingual plugin installed. I also upgraded to the latest version in case that helped.

Just let me know if there is any other information you need. Thanks!

August 6, 2019 at 1:32 pm #4347799

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+02:00)

Hi,

actually, we have a few tickets about Yoast redirections. In one of them, the suggested workaround was using the absolute link without the language prefix.

I suppose in your case the slug is the same in both languages? Could you test with a page with different URls and see if it works?
For example, if you have mysite.com/page and es.mysite.com/page, try to set the Spanish page as es.mysite.com/spanishpage and see if setting the redirect in Yoast as /spanishpage work.

August 6, 2019 at 1:39 pm #4347875

michaelL-5

Hi Laura,

Thanks for that. Just to clarify, it works fine if the original slugs are different, sure, but we are redirecting an old site where we need have one original slug go to a different place per language.

Can I ask how the absolute link was used? In my case I tried that and get the following error when I try to save: "The old URL for your redirect is not relative. Only the new URL is allowed to be absolute. Make sure to provide a relative old URL."

Thanks in advance,
Alicia

August 6, 2019 at 4:03 pm #4349441

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+02:00)

Hi,

sorry, my bad. I meant "relative URLs" so this doesn't apply to you.

So you have only one link that needs to be redirected to 2 different places, or are 2 languages with the same page slug? If it's the first case I don't think it can be solved without custom work.

The topic ‘[Closed] Redirects are not localized per language in the Yoast plugin’ is closed to new replies.