Be sure to checkout our newest add-on Reading Time Pro!

EE4 compatibility updates:

  • Publisher is EE4 and EE5 compatible, but it does not currently support the Fluid field (it's in the works).
  • Reel is EE4 and EE5 compatible, but it does not currently support the Fluid field.

Ticket: Entering URL directory will ignore the language set by the Switch Language URL

Status Resolved
Add-on / Version Publisher 2.10.6
Severity
EE Version 4.3.8

Hop Studios

Feb 28, 2019

Please take a look at this testing site.
http://ee4.hopexperiment.com/testing/switch_translate_url
Switch to es using the link on top
then manually enter http://ee4.hopexperiment.com/testing/switch_translate_url in the url and you will see a brief redirect error before going to the page.
But I think Publisher should redirect to http://ee4.hopexperiment.com/es/testing/switch_translate_url since we change the language with the switch_language_url?

#1

BoldMinded (Brian)

Feb 28, 2019

So, setting the Redirect Type in the Miscellaneous Settings to 302 corrects the issue. Fortunately, I can replicate this locally in my dev environment when I set the redirect method to 301 and have the same URL Translation settings that you do.

#2

BoldMinded (Brian)

Feb 28, 2019

Comment has been marked private.

#3

Hop Studios

Mar 01, 2019

Hello Brian,

I tried your build and the redirect too many times error is now gone. However, I still want to verify with you to see if this is the expected outcome.
Let’s say I have a hard coded a tag with href=”/testing/iframe” on this page http://ee4.hopexperiment.com/testing/switch_translate_url. If I switch the language by clicking {switch_language_url} I get taken to http://ee4.hopexperiment.com/es/testing/switch_translate_url. Then if I click that a tag, I go back to the en version (without the language prefix). Shouldn’t it be automatically redirected to the es url?

#4

BoldMinded (Brian)

Mar 01, 2019

Yeah, that’s the expected outcome. You’ve defined not to show the default language code in the url, so going to a url without the language code means it’s going to set the site to the default language.

#5

Hop Studios

Mar 01, 2019

I guess I just misunderstood the concept. What’s the major difference between switch_language_url vs translated_url?
I always thought that the switch_language_url saves a session or cookie to force redirect to the switched language if the language prefix in the url does not match the set language.

#6

BoldMinded (Brian)

Mar 02, 2019

If you want to explicitly change languages, then I’d recommend using switch_language_url. translated_url is more for use when you’re listing all the languages, such as in meta data tags to list alternate versions of content, e.g.

<link rel="alternate" hreflang="en" href="https://www.site.com/about">
<link rel="alternate" hreflang="de" href="https://www.site.com/de/about">
#7

Hop Studios

Mar 06, 2019

Sounds good. This can be closed 😊

Login to reply

Contact

For add-on support, please use the Support section. General inquries and pre-sale questions can be sent to support@boldminded.com.