Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Redirect a disabled language

Status Resolved
Add-on / Version Publisher 2.10.7
Severity
EE Version 5.2.1

Werner Gusset

Mar 25, 2019

Default language is ‘en’, second is ‘de’ and the third language ‘fr’ was disabled, it had some entries at that time.

If the link is https://www.domain.ch/fr now (from Google or by hand) it redirects to https://www.domain.ch/en/fr and to our error page. How can I make it to go to https://www.doamin.ch/en ?

Werner

#1

BoldMinded (Brian)

Does this happen in a private browsing window? Meaning it is a brand new user with no previous Publisher related cookies present?

#2

Werner Gusset

It looks like that. Deleted all cookies before calling /fr

#3

BoldMinded (Brian)

I did a quick test this morning in my local environment and it actually threw an EE error page stating the requested page can’t be found, which isn’t the behavior you are getting. TBH your quickest fix is to just add a server redirect, or use something like Detour Pro to do the redirect for you. I can look into patching Publisher, but due to my current schedule it could be a few days before I can look into this.

#4

Werner Gusset

I can accept this answer, Brian. It isn’t a big thing. I will have a look at Detour Pro.

Thank you.

#5

Werner Gusset

Just to add the experience with Detour Pro

Configured a 301 from fr to en

https://www.domain.ch/fr gives an URL of https://www.domain.ch/en/en

I suspect Detour Pro does not work with Publisher. The page on Devot-ee says so.

#6

Werner Gusset

And this in the htaccess

//301 Redirect Entire Directory RedirectMatch 301 /fr(.*) /en/$1

https://www.domain.ch/fr gives an URL of https://www.domain.ch/en/en

Just to complete my tests

#7

BoldMinded (Brian)

We use Detour Pro extensively with jamf.com, which also uses Publisher. So they do work together.

Can you take a screenshot of your URL Translation settings in Publisher? I need to see what your settings are so I might be able to figure out why it’s redirecting like that.

#8

BoldMinded (Brian)

Comment has been marked private.

#9

BoldMinded (Brian)

Comment has been marked private.

#10

Werner Gusset

With this build the redirect with htaccess has no error anymore and goes to the correct URL.

Testet with Detour Pro and it has always /en doubled.

It goes to en/en/company/category/about-us and not to en/company/category/about-us like configured in Detour Pro

#11

BoldMinded (Brian)

I’m not entirely following. You should not need Detour Pro or the htaccess redirects. Please remove both to test the new Publisher build.

#12

Werner Gusset

OK, then I misunderstood something.

tested without any redirection and it goes to /en/fr like before.

#13

BoldMinded (Brian)

Werner, the more I spent looking into this, I realized that

1) this is a very difficult problem to fix in the code. Not because writing code is hard, but because there are a ton of scenarios that need to be considered, almost too many to write code for.

2) I’m not entirely sure it’s up to Publisher to determine the correct URL. That may sound weird, but bear with me. If a language is disabled, then no where on the site should there be a link that points to the disabled language. So naturally a user can’t navigate to it to create a bad page request. If the user is manually editing the URL, then anything they change it to that is incorrect should be a 404, regardless if it’s a language code or not, and if they change the first segment code to any 2 characters that look like a language code, it should probably 404, not redirect to the home page of the default language. If for some reason Google or another search engine indexed a URL with a now disabled language, then that too is also an indexing issue, which shouldn’t be left up to Publisher to fix, because any invalid URL that gets indexed is still an indexing issue.

This sounds like a unique case (b/c I have not heard of similar reports in the 6+ years Publisher has been available), and I would recommend fixing this with a server side redirect instead of within Publisher’s codebase.

#14

Werner Gusset

Hi Brian

I can accept your answer.

A redirect in htaccess from /fr to /en would do.

I personal do not care much about how the URL looks if it shows our 404 page. Important is the message. But the client wanted me to change the URL.

I don’t mind if you close this ticket.

Thank you

Login to reply