« Atrás

Making home URL and web content SEO friendly URL highly configurable in multiple web sites

General Blogs 9 de marzo de 2011 Por Jonas Yuan

User Interfaces may get affected when using friendly URL routing and mapping. URL routing or mapping could shorten URL, as you can see in browsers. A route is a pattern for a URL. It includes named fragments automatically parsed from the URL into the parameter map. Every URL parsed by a route could also be generated from the resulting parameter map. Abstracted from the book: Liferay User Interface Development.

In addition, the portal is integrated with UrlRewrite filter. Based on the mod_rewrite for apache, UrlRewrite filter is a Java Web Filter for any J2EE compliant web application server, such as Resin, Orion, or Tomcat, which allows us to rewrite URLs before they get to the code. Refer to http://tuckey.org/urlrewrite/. Performance on the UrlRewrite filter is very good and the UrlRewrite filter allows for convenient configuration of URLs where JkMount is pointing to /* or the web server isn't running behind Apache. Abstracted from the book: Liferay Portal 6 Enterprise Intranets

In brief, Liferay provides friendly URL framework and integrate UrlRewrite filter. This article will consider more specific use cases.

  • Use case A: home URL for each web site should be configurable; and hide home URL when hitting domain name only;
  • Use case B: keep existing web content SEO friendly URL AS IS; when hitting these web content friendly URL, display that web content without redirecting behaviors;
  • Use case C: provide new configurable SEO friendly URL for newly created web content; when hitting these web content friendly URL, display that web content without redirecting behaviors;

This article is going to show how to implement above use cases as new features in Liferay 6.

Configurable home URL

For the use case A, considering scenario: there is one portal instance, two groups (either communities or organizations): street and workshop. Each group has its own virtual host like street.bookpub.com, workshop.bookpub.com. Each group has its own public pages and private pages.

For example, the group street has following page structure
Home
    Test
    Demo
Resource
Help

And each page has its own friendly URL like /home, /resource, /help, /test, /demo

For instance, the group workshop has following page structure
Help
Resource
Test
    Demo
Home

And each page has its own friendly URL like /help, /resource, /home, /test, /demo

Requirements:

  • Set home URL globally – scoped to portal-instance, like /test
  • When hit URL: http: //street.bookpub.com[/], it should show the page /test of the group street;
  • No redirect in the picture; that is, the URL http: //street.bookpub.com[/] stays non-changed.
  • When hit URL: http: //workshop.bookpub.com[/], it should show the page /test of the group workshop;
  • Again there is no redirect in the picture; that is, the URL http: //workshop.bookpub.com[/] stays AS IS.

Is this useful use case?

Web content SEO friendly URL

For the use cases B and C, considering scenario, there are thousands press release articles got released in past ten years. Each article has its own SEO friendly URL, like http://street.bookpub.com/dlls/2011/prod_030311c.html.  The URL has following pattern.

http://street.bookpub.com/dlls/${year}/${title.name}.html

Where ${year} stands for the value of the year, like 2011; ${title.name} stands for SEO friendly title, created by editorials. The title will take characters a-z, A-Z, 0-9, and “ -_.”  (empty space, hyphen, underscore, period).

Now it is time to use Liferay WCM to manage all press release articles, while all SEO friendly URLs should get supported AS IS.

Similarly, manage features, videos and pod casts in WCM of Liferay as well.  After migration, new press release articles, features, video and pod casts will have new friendly URLs with following pattern.

http://street.bookpub.com/${type.name}/${id.value}/${title.name}

Where {type.name} could have values: release, feature, video, and podcast; ${id.value} presents article ID value; ${title.name} stands for SEO friendly URL title, created by editorials.

And set the list of article types, for example:

journal.article.types=announcements,blogs,general,news,release,feature,video,podcast

Are these useful use cases?

Solution proposals

  • Add following properties

## Home URL enabled or disabled
virtual.host.home.url.enabled=true

## Default home URL value. It will be used only if the property
## virtual.host.home.url.enabled is true, and home URL in Control Panel
## settings has value NULL.
## That is, home URL value could be reset in Control Panel
virtual.host.home.url.name=/test

  • Implement home URL as new feature.
  • Implement web content friendly URL as new feature

Testing results

home URL for street.bookpub.com

home URL for workshop.bookpub.com

Web content existing friendly URL

Web content SEO friendly URL

Summary

As you can see, Liferay could be used as a framework to present any kind of SEO friendly URL. For testing purpose, these features would be available as a fix patch for Liferay 6.0.

Last but not least, I'd like to send special thanks to Eduardo Carneiro, Rommel Bermudez, Duncan McKeever, Mark Wynne who provided these requirements.

Respuestas anidadas Autor Fecha
hi, Maybe it's just me, but I don't understand... Felipe Sere 11 de marzo de 2011 1:29
Hi Felipe, Thanks. Both home URL and web... Jonas Yuan 11 de marzo de 2011 6:21
Is this patch somewhere available ? This is... constantin köck 16 de marzo de 2011 9:24
Hi constantin, Thanks. Which version are you... Jonas Yuan 17 de marzo de 2011 17:11
I am using 6.0.6 CE ... i would have given all... constantin köck 21 de marzo de 2011 11:47
Hi constantin, thanks. drop email to... Jonas Yuan 23 de marzo de 2011 7:03
Hi everybody, I'm using 6.0.5 CE. I'd like to... Riccardo Rotondo 30 de marzo de 2011 0:16
Hi Riccardo, thanks. You can drop email to the... Jonas Yuan 30 de marzo de 2011 6:10
Mmm, I didn't receive no mail anymore... I... Riccardo Rotondo 21 de abril de 2011 1:56
Hi Riccardo, sorry that I did not find any... Jonas Yuan 21 de abril de 2011 10:19
Hi Riccardo, just sent email for some detailed... Jonas Yuan 26 de abril de 2011 15:54
[...] Loosely speaking, a newsroom is the place... Anónimo 21 de junio de 2011 12:46
[...] Loosely speaking, a newsroom is the place... Anónimo 21 de junio de 2011 15:11
Hello, Jonas I'm using Liferay Portal Community... Oleksandr Kiricheyko 22 de agosto de 2011 2:45
Hi Oleksandr, You may check the real example:... Jonas Yuan 7 de septiembre de 2011 10:37

hi,
Maybe it's just me, but I don't understand the last few bits:

"Implement home URL as new feature.
Implement web content friendly URL as new feature"

What am I supposed to do here?

Felipe
Publicado el día 11/03/11 1:29.
Hi Felipe, Thanks. Both home URL and web content friendly URL were implemented as a fix patch here. These features are in review so far for now. Thus For testing purpose, these features would be available as a fix patch for Liferay 6.0.

Are there features useful?

Thanks

Jonas Yuan
Publicado el día 11/03/11 6:21 en respuesta a Felipe Sere.
Is this patch somewhere available ? This is really interesting stuff.
Publicado el día 16/03/11 9:24 en respuesta a Jonas Yuan.
Hi constantin, Thanks. Which version are you using? 6.0.6 CE GA 4? or 6.0 EE SP1?

By the way, which use case do you want to test?
only Use case A? or
Use cases B and C?

The fix patch will be 100% version based.
Publicado el día 17/03/11 17:11 en respuesta a constantin köck.
I am using 6.0.6 CE ... i would have given all of them a try ...
But b and c seem to be more complex ..

Regards C
Publicado el día 21/03/11 11:47 en respuesta a Jonas Yuan.
Hi constantin, thanks. drop email to jonasliferay@gmail.com, thus I would send you the fix patch for 6.0.6 CE GA4.
Publicado el día 23/03/11 7:03 en respuesta a constantin köck.
Hi everybody, I'm using 6.0.5 CE. I'd like to have the patch too for the Use Case C. Can I send a mail of request to the same address?
Another question, in use case C they said Use case C:
"provide new configurable SEO friendly URL for newly created web content; when hitting these web content friendly URL, display that web content without redirecting behaviors;"
This means that I can't have a friendly URL for the web content I've already created?

Thank you for your help.

Regards
Publicado el día 30/03/11 0:16 en respuesta a Jonas Yuan.
Hi Riccardo, thanks. You can drop email to the same address for 6.0.5 CE GA3.
Publicado el día 30/03/11 6:10 en respuesta a Riccardo Rotondo.
Mmm, I didn't receive no mail anymore... I thought this tool was free and available for the whole community regardless their activities but probably I was wrong. Any other suggestions from others how to realise the same result?
Publicado el día 21/04/11 1:56 en respuesta a Jonas Yuan.
Hi Riccardo, sorry that I did not find any chance to ask you more requirements, since I got blocked by a big client. I am super busy this week. I will come back to you next week.

In fact, I do need more detailed requirements from your side before sending free fix patch. I will drop an email to you shortly.
Publicado el día 21/04/11 10:19 en respuesta a Riccardo Rotondo.
Hi Riccardo, just sent email for some detailed requirements. Hope that you did receive it.

Thanks

Jonas
Publicado el día 26/04/11 15:54 en respuesta a Riccardo Rotondo.
[...] Loosely speaking, a newsroom is the place where journalists—reporters, editors, and producers, along with other staffers—work to gather news to be published in a newspaper or magazine or broadcast on... [...] Read More
Publicado el día 21/06/11 12:46.
[...] Loosely speaking, a newsroom is the place where journalists—reporters, editors, and producers, along with other staffers—work to gather news to be published in a newspaper or magazine or broadcast on... [...] Read More
Publicado el día 21/06/11 15:11.
Hello, Jonas
I'm using Liferay Portal Community Edition 6.0.6 CE
I would like to obtain this patch. All A,B,C cases are needed. Can you send it to me?
Thank you in advance
Publicado el día 22/08/11 2:45 en respuesta a .
Hi Oleksandr,
You may check the real example:
http://newsroom.cisco.com/
where use cases: A, B, C got applied.

Your requirements should be different from the NewsRoom, Thus you can drop email to jonasliferay@gmail.com, where we can discuss the details.

Thanks

Jonas
Publicado el día 7/09/11 10:37 en respuesta a Oleksandr Kiricheyko.