掲示板

Friendly URL not redirecting when using localized URL

6年前 に Antonio Dragone によって更新されました。

Friendly URL not redirecting when using localized URL

New Member 投稿: 2 参加年月日: 17/05/09 最新の投稿
Hi all!

I'm quite new to Liferay and I'm having an issue when using localized friendly URLs. I'm not sure if this is a misconfiguration or what.

I'm using Liferay 6.2.5 CE (GA6).

My site has two languages, Spanish and English, being Spanish the default. There are friendly URLs configured for some pages, for example, an about us page has:

-Spanish: www.mysite.com/nosotros
-English: www.mysite.com/about-us

If I try to open www.mysite.com/about-us from a browser that never visited my site or if the site has Spanish selected, it will show a blank screen. When I open a new tab and browse www.mysite.com/nosotros it shows the "You were redirected to..." message at the top of the page and renders the page in the default language. If I click the link to the "original link" shown at the top, it redirects me to "www.mysite.com/en/about-us" which is the link I am supposed to be redirected from www.mysite.com/about-us.

What is hapening here? Did I miss a configuration option? (I left portal properties related to localization as default).

It is important to note that I am accessing the site as a guest.

What I have to do to be automatically redirected to /en/about-us?

Thanks in advance!
thumbnail
5年前 に Marco Azzalini によって更新されました。

RE: Friendly URL not redirecting when using localized URL

Regular Member 投稿: 146 参加年月日: 14/11/18 最新の投稿
Hi Antonio. It's quite a long time since your post but I recently did an upgrade to 6.2 GA6 and I am experiencing very similar behavior.
Did you ever find a solution?

regards,
Marco
5年前 に Antonio Dragone によって更新されました。

RE: Friendly URL not redirecting when using localized URL

New Member 投稿: 2 参加年月日: 17/05/09 最新の投稿
Hi Marco!!

I couldnt find a solution for the issue. The only workaround was not to use the automatic language detection redirects altogether.

You can do that by changing portal property "locale.prepend.friendly.url.style" in the "portal-ext.properties" file.

The default value is 3, I have changed it to 2.

(See: https://docs.liferay.com/portal/6.2/propertiesdoc/portal.properties.html)

What you are doing here is forcing the URLs to be like "http://www.example.com/en/about-us" and "http://www.example.com/es/nosotros", not relying on liferay's language autodetection.

Hope this helps.
thumbnail
5年前 に Marco Azzalini によって更新されました。

RE: Friendly URL not redirecting when using localized URL

Regular Member 投稿: 146 参加年月日: 14/11/18 最新の投稿
Hi Antonio, thank you for your reply. Actually I am still considering if the upgrade to GA6 is possible for us. I recently discovered a new bug that affect the GA6 version and that I think will stay 'open' for ever (LPS-66712).
In next few days we will have to take a decision if move anyway to GA6 or stay on GA3...

Marco