Letzte Blogger

Neil Griffin

57 Nachrichten
13. September 2017

David H Nebinger

61 Nachrichten
8. September 2017

Yanan Yuan

5 Nachrichten
6. September 2017

Minhchau Dang

12 Nachrichten
6. September 2017

Sarah Heiniger

3 Nachrichten
4. September 2017

Dániel Jávorszky

1 Nachrichten
4. September 2017

Pradeep Sharma

2 Nachrichten
25. August 2017

William Jameson

11 Nachrichten
24. August 2017

Andrew Jardine

3 Nachrichten
18. August 2017

sejal patel

2 Nachrichten
16. August 2017
« Zurück

Localize Layout Friendly URLs

Company Blogs 7. August 2013 Von Sergio González Staff

Lately I have been working on a new feature that many users have asked for a long time and Liferay didn't support it (yet).

As most of you know, friendly URLs are very important nowadays for several reasons, although I would say that the two most important ones are:

  • SEO: it definitely improves the ranking of a site when the urls of that site are friendly
  • Usability: from the user point of view, if we have a nice friendly url we provided to the end user with helpful information. Even sometimes, friendly urls can behave as a breadcrumb, and allows the user to modify them and visit the pages they want just by modifying the url. 

In Liferay 6.1 and previous, site admins could add Pages and update friendly URLs for those pages from the UI. However, those friendly URLs were not localizable. This means that, in sites with more than one language, the friendly URL for the pages was useful only for part of the people (people who understand the language the friendly URLs are written)

From 6.2 and on we allow localized friendly urls, so for a single page, we can have many different friendly urls for different locales. Then, for the homepage we could have /home (english) and /inicio (spanish), so when an user whose language is English hits the frontpage, he will see in the url www.example.com/home and if i'ts a Spanish user he will see www.example.com/inicio



All the links will be generated considering the user language, so the right friendly url will be automatically used for every link. Then, you may be wondering, what will happen if english user copy/paste his URL (www.example.com/home) to his spanish friend? Will the spanish user access the right page? Will he see the content in English? Spanish?

In that case, the user will be automatically redirected to the friendly url in his own language and a non obtrussive message will be displayed for 10 seconds notifying the redirect to the user and allowing him to access the original link.


I Hope you like it. I'm looking forward to hear your feedback.

Antworten im Thread Autor Datum
What a great feature. I love to see it getting... Oliver Bayer 7. August 2013 02:50
I hope it will be possible to disable the... Daniel Lupescu 8. August 2013 01:31
Hey Dan, Right now there is no way to disable... Sergio González 23. September 2013 07:48
Hi Sergio, after reading it twice I'm having... Oliver Bayer 12. August 2013 05:04
Hey Oliver, Unfortunatelly we didn't implement... Sergio González 23. September 2013 07:49
Great great feature to SEO improvement in... Miguel Ángel Pau 23. August 2013 03:48
Thanks a lot! This feature got implemented in... Jonas Yuan 23. August 2013 10:45
WIll it be possible to distinguish between... Ewan Gilmour 7. Oktober 2014 01:54
How to disable this? We have just one language... Michal Sima 5. November 2014 03:00

What a great feature. I love to see it getting implemented as I've asked for it several times. Now I "only" have to master the upgrade process ;).
Gepostet am 07.08.13 02:50.
I hope it will be possible to disable the automatic redirection and modify the 10 seconds duration using properties in the portal-ext.properties.
Gepostet am 08.08.13 01:31.
Hi Sergio, after reading it twice I'm having one question ;). Is this feature also applied to community/ site names?? It woulbe be really useful if the friendly url of site names could be localized too. Greets Oli
Gepostet am 12.08.13 05:04.
Great great feature to SEO improvement in portals in many languages !! Thanks!!
Gepostet am 23.08.13 03:48.
Thanks a lot! This feature got implemented in 6.2 finally.
Gepostet am 23.08.13 10:45.
Hey Dan,

Right now there is no way to disable the notification message via portal.properties because it's a situation that should rarely occur. Anyways, all the logic to display the message is handled in top_messages.jsp, so you can easily change the behaviour by using a JSP hook.
Gepostet am 23.09.13 07:48 als Antwort auf dan dan.
Hey Oliver,

Unfortunatelly we didn't implement it for site names emoticon
Hopefully we can do it for 6.2.
Gepostet am 23.09.13 07:49 als Antwort auf Oliver Bayer.
WIll it be possible to distinguish between languages in the site using a slash in the URL? For example for the home page - in English we name the page /en/home and in Spanish we name the page /es/inicio . Will it be possible to enter slashes in the URLs in this way?

I am just trying to determine that there will be an easy way we can set different language parts of the site in Google Webmaster Tools. ie. all english pages on /en/ and all Spanish pages on /es/ . What is the best way to facilitate this within Liferay?

Gepostet am 07.10.14 01:54.
How to disable this? We have just one language in the site (French), but it is possible to set friendy URLs for English and French. We do not want this redirection alert to be active.
Gepostet am 05.11.14 03:00.