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

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.

博客
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
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
Is this patch somewhere available ? This is really interesting stuff.
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.
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
Hi constantin, thanks. drop email to jonasliferay@gmail.com, thus I would send you the fix patch for 6.0.6 CE GA4.
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
Hi Riccardo, thanks. You can drop email to the same address for 6.0.5 CE GA3.
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?
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.
[...] 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
[...] 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
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
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