Localize Layout Friendly URLs

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.

Blogues
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 ;).
I hope it will be possible to disable the automatic redirection and modify the 10 seconds duration using properties in the portal-ext.properties.
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.
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
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?

Thanks
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.