Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • IBM Digital Experience wiki
  • All Wikis
  • All Forums
  • ANNOUNCEMENT: WIKI CHANGE TO READ-ONLY. LEARN MORE...
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
  • API Documentation
Search
Community Articles > IBM Web Content Manager > Implementing friendly URLs in IBM Web Content Manager(WCM) servlet based rendering
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Click to view profileIBM contributorAmit Pareek
Contribution Summary:
  • Articles authored: 2
  • Articles edited: 0
  • Comments Posted: 8

Recent articles by this author

Implementing friendly URLs in IBM Web Content Manager(WCM) servlet based rendering

This white paper provides an implementation approach for short urls in websites built using IBM Web Content Manager (WCM) and rendered using the servlet based delivery model. Specifically this white paper details the approach to deliver websites with WCM that do not include the context and ...

Implementing friendly URLs in IBM WebSphere Portal 8-based WCM rendering

This article showcases the new feature in version 8 of IBM WebSphere Portal IBM Web Content Manager (WCM) with which you can implement a clean-navigation, stateless URL in Portal-based WCM delivery. Also referred to as friendly URLs or human readable URLs.
Community articleImplementing friendly URLs in IBM Web Content Manager(WCM) servlet based rendering
Added by IBM contributorAmit Pareek | Edited by IBM contributorAmit Pareek on January 3, 2014 | Version 7
expanded Abstract
collapsed Abstract
This white paper provides an implementation approach for short urls in websites built using IBM Web Content Manager (WCM) and rendered using the servlet based delivery model. Specifically this white paper details the approach to deliver websites with WCM that do not include the context and servlet paths within the URLs of content.
Tags: servlet rendering, Short URL, Web Content Management, WebSphere Portal

Pre-requisite


You should have good understanding of IBM WCM version 6.1/7/8, IBM HTTP server and IBM Edge caching proxy component.

Introduction


Many public websites are implemented using IBM WCM servlet based rendering, and out of the box all URLs follow the standard WebSphere servlet context path conventions For WCM most URLs look this this:
:/ wps/wcm/connect/// .

The context and servlet paths, which typically in WCM are /wps/wcm/connect, does not make sense to end users and makes the URLs longer, complex and harder to remember.

With the evolution of SEO friendly urls/short urls, customers desire short URLs for their pure wcm based sites.

In the case of SEO when a new requirement for site development is defined the IT department will include a url structure sheet. These URLs are typically provided by an SEO vendor and the desire is to manage the site within WCM with the exact url as provided by the SEO vendor .

For example a telecom website url structure contains a prepaid and postpaid page under the customer segment .

/customer/prepaid
/customer/postpad

By default when this requirement is implemented using WCM, the final URL when the user navigates to the page will appear like this:

www.Domain name.com/wps/wcm/connect/customer/prepaid
www.Domain name.com/wps/wcm/connect/customer/postpad

The good news is that it is possible to provide shortened URLs very easily with a combination of the following products:
  • IBM WCM and IBM Web Server.... or
  • IBM WCM and IBM Edge caching proxy server.

Different user role involved in this solution development.
  • WCM developer
  • Infrastructure specialist

Different use cases where short url can be implemented


Use case 1:


When the infrastructure has these components:-


1) IBM HTTP Server.
2) IBM WCM server.

Portal infrastructure looks like this -



Customer Requirement:-


1) New WebSite should have a prepaid plans section under customer section.
2) Its target url :- /customer/prepaid.

What happen in normal scenarios -

WCM Development team:-


1) Create a WCM library named “customer”.
2) Create site area name as prepaid.
3) Preview the site area :- It will generate the url as
/wps/wcm/connect/customer/prepaid

Infrastructure team:-

1) Generate the WAS plugin and include plugin.xml file into plugins folder of HTTP server .

End user:-


1) Hit the customer page .
URL in the browser will be :-
/wps/wcm/connect/customer/prepaid

Result :-


Page opens with a long url structure having /wps/wcm/connect context path in it.

Implementing short url changes at HTTP server .


To implement short url, IBM HTTP server provide mod_proxy module, which proxies the requested url.
Infrastructure specialist need to apply few changes to implement short url.

Changes at HTTP server side


1) Open httpd.conf file and enable below mentioned modules.

By uncomment them
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
2) Write ProxyPass rule to proxies the url .
ProxyPass /customer/ http://PortalIP/wps/wcm/connect/customer/
This rule will internally proxy any url containing /customer/ and server the request from http://PortalIP/wps/wcm/connect/customer/
3) From now onwards whenever user type this in browser
/customer/prepaid

It will be proxied at http server level and internally request will be served from
http://PortalIP/wps/wcm/connect/customer/prepaid

For your reference :- http://httpd.apache.org/docs/2.2/mod/mod_proxy.html


Use case 2:-


When the infrastructure has these components:-


1) IBM Edge proxy component.
2) IBM HTTP Server.
3) IBM WCM server.

Portal infrastructure looks like this -



Customer Requirement:-


1)New WebSite should have a prepaid plans section under customer section.
Its target url :- /customer/prepaid

What happen in normal scenarios -

WCM Development team:-


1) Create a WCM library named “customer”.
2) Create site area name as prepaid.
3) Preview the site area :- It will generate the url as
/wps/wcm/connect/customer/prepaid


Infrastructure team:-

1)At edge proxy component, under ibmproxy.conf file make an entry which makes a connection between ibm proxy and http server.

Proxy /* http://HTTP Server IP/* :80


End user will hit the portal server and access the prepaid page.

URL in the browser will be :-
/wps/wcm/connect/customer/prepaid

Changes to be done to implement short url -



At IBM Edge proxy component side

1)Open ibmproxy.conf file and enable below mentioned modules.
2)Write Proxy rule to proxies the url .
Proxy /customer/* http:///wps/wcm/connect/customer/
This rule will internally proxy any url containing /customer/ and serves the request from http://PortalIP/wps/wcm/connect/customer/*

3) From now onwards whenever user type this in browser
/customer/prepaid

It will be proxied at IBM Edge proxy component level and internally it will be served from
http:///wps/wcm/connect/customer/prepaid


Changes required at WCM side

Up to this point we have configured the Proxy rule with the IBM HTTP web server or IBM Edge caching proxy so that short URLs can be re-reouted to WCM correctly.

The next part of this document will cover the changes to be done within the site managed and delivered by WCM. This part is the same for both the use cases.

This is a necessary step as WCM will still render HTMLwith long URLs that are generated using WCM tags.
[Placeholder tag] , [link tag] etc .
These tags applied on Navigator component , Menu component, Presentation templates.

We need to make sure HTML generated by WCM presentation template should not have long URL which contain ‘/wps/wcm/connect/’ .

Generally a WCM developer use below mentioned tag’s to generate url’s for content / Site Area / Components .

1) [Placeholder tag="titlelink"]

Generated HTML Markup –
< a href="/wps/wcm/connect/connect/customer/prepaid" > Prepaid </a>
2) [Placeholder tag="href"]

Generated HTML Markup -

/wps/wcm/connect/customer/prepaid /

3) [Component name="design/link components/link_backlink_coc"]
Generated HTML Markup -
<a href="/wps/wcm/connect/investor-relations/code+of+conduct"></a>

Tag format to implement short URL

To render short form URLs it is necessary to change the tags used to construct the markup, and instead of WCM generating the anchor tag the markup will be entirely defined within the HTML field with the WCM tags providing path information.

For example:

1) [Placeholder tag="sitepath"]


tag="sitepath"This tag will generate link in this format: - /Library Name/Site Area/Site Area .


< a href='[Placeholder tag="sitepath"]' >[Placeholder tag="title"]< /a >
Generated HTML Markup

<a href="/customer/prepaid ">Prepaid</a>


2) [Component format="path" ] tag

format="path" :- This tag will generate link in this format: - /Library Name/Site Area/Site Area/Content

This tag is valid for Link components .

Below example generating url for a link component

[Component name="design/link components/link_backlink_coc" format="path"]


Generated HTML Markup

/investor-relations/code+of+conduct



Note :- Hard coded link should not contain /wps/wcm/connect in there url .


Now we have proxy rule at HTTP server and IBM Edge caching proxy component our WCM tags has been modified to implement short url .

Let’s discuss what is happening in a sequence.

Final flow




1) User types /customer/prepaid in the browser .
2) Request is first taken by HTTP server or Edge caching proxy .
3) Proxy rule start working –
a. Finds the /customer/ in the url .
b. Applies the proxy rule and internally get response from /wps/wcm/connect/customer/prepaid .
c. User get the appropriate page, url for the end user remain short and beautiful.
d. HTML serve by the response have wcm short links for example /customer/postpaid .
e. When user click on the postpaid link , again same rule apply and the sequence of same rule starting 1 will apply .
Conclusion


You should now be able to implement the short URL feature in WCM servlet based delivery.

This technique can be introduced into an existing site gradually or only partially as all existing URLs will continue to work even with the proxy rules in place.

Author


Amit Pareek – ampareek@in.ibm.com
expanded Attachments (0)
collapsed Attachments (0)
expanded Versions (10)
collapsed Versions (10)
Version Comparison     
VersionDateChanged by              Summary of changes
10Jan 3, 2014, 12:43:04 PMAmit Pareek  IBM contributor
8Jan 3, 2014, 12:35:15 PMAmit Pareek  IBM contributor
This version (7)Jan 3, 2014, 12:32:42 PMAmit Pareek  IBM contributor
6Jan 3, 2014, 12:27:24 PMAmit Pareek  IBM contributor
5Jan 3, 2014, 12:18:16 PMAmit Pareek  IBM contributor
4Jan 3, 2014, 12:08:57 PMAmit Pareek  IBM contributor
3Jan 3, 2014, 11:52:42 AMAmit Pareek  IBM contributor
2Jan 3, 2014, 11:48:09 AMAmit Pareek  IBM contributor
1Jan 3, 2014, 11:38:12 AMAmit Pareek  IBM contributorYou should now be able to implement the short URL feature in WCM servl...
1Jan 3, 2014, 11:45:06 AMAmit Pareek  IBM contributor
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkThe Social Lounge
  • Wiki Help
  • Forgot user name/password
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use