Tuesday, 1 July 2014

Websphere Commerce Search Engine Optimization (SEO) URL

Search engines, such as Google, are considered to be one of the most important channels for a site to reach new customers. To build a loyal customer base, the first step is to reach new customers. Search engines provide an effective way to do this. Dynamic, database-driven URLs, such as those generated by WebSphere Commerce, contain stop characters that can easily overwhelm search engine crawlers. For this reason, search engines limit the number of dynamic URLs that they index. To overcome this limitation, WebSphere Commerce provides search engine optimization capability to help improve the results of search engine indexing.

The existing WebSphere Commerce search engine optimization feature consists of three parts. URL mapping provides the ability to remove stop characters by mapping WebSphere Commerce's dynamic URLs to static ones so that search engines can index the dynamic pages. Site map capability provides an entry point for the search engine crawler to easily follow the links within your web pages. Page content optimization facilitates keyword modification so that the page is ranked high in search engine results. It provides the ability to easily modify words in the locations that are important for crawlers by using the Product Management GUI or Change Pages GUI in WebSphere Commerce Accelerator.

Creating SEO friendly URLs

SEO friendly URL can be created by  two methods as shown below.

1.Shorten the context root of store page
2.By making use of either SEOUrlMapper.xml (Till WCS 7 Feature Pack2  )   or SEOUrlpatterns.xml (From WCS 7 Feature Pack 3) in websphere Commerce.

Step 1: Shorten store page context root for improved readability

Full URL
Shortened URL

Step 2: Create easy to read static URLs with keywords to support search engine indexing(making use of either SEOUrlMapper.xml or   SEOUrlpatterns.xml )
Dynamic URL

Static URL till Websphere Commerce 7  Feature Pack2( SEOUrlMapper.xml)


Static URL from  Websphere Commerce 7 Feature Pack 3 onwards(SEOUrlpatterns.xml)


Shortening the context root of a store URL:

Shortening the context root of a store's URL makes it easier for shoppers to remember a link and also improves visibility in search engine results.You can shorten the URL for your store by modifying the context root. You can change the default site URL from http://hostname/webapp/wcs/stores/servlet/StoreName/index.jsp to something shorter, such as: http://hostname/shop/StoreName/index.jsp. In this example, shop is used to replace the context root, but any name can be used in its place. 

For example: 
Old URL:
New URL:

To achieve this functionality(Shortening the context root )we need to update below files:

1.httpd.conf (if webserver is IBM HTTP Server)


httpd.conf changes:

If you are running an IBM HTTP Server:

Open the httpd.conf file for editing.
Locate the virtualhost object: <VirtualHost servername:80> Insert the following code inside the <VirtualHost servername:80> object before the ending </VirtualHost> tag.

RewriteEngine on
RewriteRule   ^shop/(.*)$      /webapp/wcs/stores/servlet/$1 [PT,NC]

Locate the virtualhost object: <VirtualHost servername:443> Insert the following code inside the <VirtualHost servername:443> object before the ending </VirtualHost> tag.

RewriteEngine on
RewriteRule ^shop/(.*)$      /webapp/wcs/stores/servlet/$1 [PT,NC] 

Wc-server.xml changes:

Open the wc-server.xml for editing.
Search for the SEOConfiguration section.
Update the  element as given below (update the context-root-rewrite with "/shop").
<SEOConfiguration defaultUrl="" dynamicUrl="true" enable="true">
<context-root-rewrite value="/shop" />

Restart your web server and app server and validate your changes.

Let us see the implementation of SEO Before Featurepack3(WCS 7 feature pak3 ) using

The dynamic URL that generates the request as shown below:-

This dynamic URL contains the stop characters  (?, %, &) and it will prevent the indexing by the search engine crawlers.To avoid this, we need to create a static URL as below:-



The static URL for all the request can be created by making an entry in the SEOUrlMapper.xml.
<pathInfo_mappings separator="_”>
<pathInfo_mapping name="CategoryDisplay” requestName="TopCategoryDisplay”>
<parameter name="storeId” />
<parameter name="languageId” />
<parameter name="categoryId” />
<parameter name="catalogId” />

Next Time when the request TopCategoryDisplay is executed, based on this mapping file URL will created as shown below. 

i.e. /CategoryDisplay_10051_-1_10501_20501

Let us see the implementation of SEO From Featurepack3(WCS 7 feature pak3 ) onwards using pattern files.

Static URL overview

To create static URLs in your store, start by identifying which pages need to be SO-friendly. In the Madisons and Elite starter stores, the product, category, search landing pages and static pages are all SEO-enabled. Next, define the structure for each static URL by defining a pattern file and loading URL keywords into the database. These steps are completed as part of store publish for the starter stores. To construct a static URL in a storefront page, use the <wcf:url> tag along with the pattern name for the URL to be created. In order for WebSphere Commerce to process the request, the original dynamic URL must be recovered from the static URL. These steps are each discussed in more detail in the below section.

Pattern file location

Place the pattern file at the below location:

Development environment: WCDE_installdir/workspace/Stores/WebContent/WEB-INF/xml/seo/stores/storedirectory

Server Environment: WC_eardir/Stores.war/WEB-INF/xml/seo/stores/storedirectory  

Let us understand different sections of pattern file in detail.

<seourl:seoUrlPatternDef name="CategoryURL"> 
<seourl:seoUrlPattern viewName="CategoryDisplay">

<seourl:mapping name="langId" value="?LanguageToken?" />
<seourl:mapping name="storeId" value="?StoreToken?" />
<seourl:mapping name="catalogId" value="?CatalogToken?" />
<seourl:mapping name="categoryId" value="?CategoryToken?" />

<seourl:mapping name="LanguageToken" value="?langId?" />
<seourl:mapping name="StoreToken" value="?storeId?" />
<seourl:mapping name="CatalogToken" value="?catalogId?" />
<seourl:mapping name="CategoryToken" value="?categoryId?" />

<seourl:usage device="browser">

Pattern files are used in the construction and deconstruction of SEO friendly URLs. Pattern file is a template for a URL type in a store, such as CategoryDisplay. Each pattern contains the parameters needed to construct a specific URL. This slide shows a snippet of the URL pattern definition for CategoryDisplay.

Section A shows the name of the pattern. This is the name that is used when constructing the URL in a JSP.
In Section B, the Struts to pattern mapping defines the pattern of the SEO URL as a series of tokens. The viewName attribute defines the Struts action mapping for the original URL. When the SEO URL is deconstructed and matched against the pattern, the request is forwarded to the corresponding viewName attribute.
Section C defines the SEO URL to parameter mapping. This mapping is used during the deconstruction of an SEO URL. Once the URL is matched against the pattern, the values associated with the tokens in the URL are mapped to the corresponding parameter names defined here.
Section D defines the SEO URL parameter to URL mapping. This mapping is used by the wcf:url tag during construction of the SEO URL. Based on the token name and token value, the URL keywords are looked up in the database and substituted for the token names in the URL pattern.
Finally, section E defines the pattern usage .

Next Modify your JSP .

In Feature Pack 3, the wcf:url tag has been enhanced to accept the new URL patterndefinition name. To use the wcf:url tag you need to know the pattern name of the SEO-friendly URL you want to construct and all of the parameters that are required for the URLsuch as categoryId, productId, and langId. This information is used by the wcf:url tag to construct the SEO friendly URL.
Modify your JSP files that use the wcf:url tag. Modifying these files create links for products, categories, and static pages to use the patterns that you defined in step 2. An extra patternName attribute needs to be added to the effected wcf:url tags. For example:

<wcf:url patternName="CategoryURL" var="categorydisplayURL" value="CategoryDisplay">   
<wcf:param name="categoryId" value="10002" />
<wcf:param name="storeId" value="10001" />
<wcf:param name="langId" value="-1" />

patternName="CategoryURL" is highlighted as shown above.

Supporting database tables for Pattern mapping are listed below.

This table is used to associate a primary token for every usage type defined in a store. This also holds information as to whether a token is static or not.
Mapping of token names and values.
Store and language specific keywords.
SEO Sample-> Setting up SEO implementation in  Madison store (WCS V7 FEP 3 Using Pattern Files)

1)From the  Madisons-FEP.sar  (WCDE_installdir\starterstores\ConsumerDirect\Madisons-FEP.sar) Extract the following  pattern  files

seourlpatterns.xml  file  is used for  for all static pages
seourlpatterns-category.xml file is used for for categories
seourlpatterns-product.xml file  for is used for products
seourlpatterns-search.xml  file for search landing pages

2)Make sure that pattern files  are copied  into below directories

Development Environment – WCDE_eardir/workspace/Stores/WebContent/WEB-INF/xml/seo/stores/storedirectory
For Extended site model, place the files in the following location as well.

3)Once Pattern files are copied, Run the Seourlkeywordgen utility. 

This utility will generate shorter URLs/static URL tokens  by reading the data from tables CATGROUP and CATENTRY for categories and products and are inserted into SEOURL and SEOURLKEYWORD tables. By default the utility generate tokens for all , products, items and categories. If we don’t need separate URLs for Items, then specify only product.xml and category.xml in ‘URLoadingConfigs’ property.

Configuration file to be copied and updated

Create an extension file wc-admin-component.xml  inside in the ext folder as below.(Inside the
SEO-BaseComponentLogic-FEP.jar file)
Change the property as below
<_config:property name=”URLloadingConfigs” value=”product.xml,category.xml” />

Sample command for running seourlkeywordgen
WC_installdir/bin/seourlkeywordgen.sh <storeId> <catalogId> <langId> /WC_eardir/xml/config/wc-server.xml WC_eardir/xml/config/com.ibm.commerce.infrastructure-fep/wc-admin-component.xml dbuser dbpassword

4)Run the below SQL scripts(One time configuration). The data from these SQL scripts will be used for SEO URL generation while using the pattern xml files .

Scripts for SEOTOKENUSGTYPE table

insert into seotokenusgtype values (-10000,'Language’,’LanguageToken’,0,0,1);
insert into seotokenusgtype values (-10001,'Store’,’StoreToken:CatalogToken’,0,0,1);
insert into seotokenusgtype values (-10002,'CatalogEntry’,’ProductToken’,0,0,1);
insert into seotokenusgtype values (-10003,'CatalogGroup’,’CategoryToken’,0,0,1);
insert into seotokenusgtype values (-10004,'Search’,’SearchTermToken’,0,0,1);

The SQL entry for 'StoreToken:CatalogToken' is used to enable SEO for sales catalog in extended sites.

Script for creating seourlkeyword for combination of catalog and store 

//SEOURL table contains token name and its values.
insert into seourl (seourl_id, tokenname, tokenvalue) values (-1000, ‘StoreToken:CatalogToken’, ‘storeId:catalogId’);

//SEOURLKEYWORD table contains keyword for the token defined in SEOURL . 
During SEO-friendly URL construction, the tokens in a URL pattern are replaced by their respective keywords and the keywords will be appearing in the SEO URL.
insert into seourlkeyword (seourlkeyword_id, seourl_id, storeent_id, language_id, urlkeyword, status)  values(-1000, -1000, 0, -1, ‘keyword', 1);

keyword can be the name of the store catalog which we may want to show the customers as the URI after the context path of the site.(for e.g madisons keyword for the token StoreToken:CatalogToken )

For eg: http:// www.store.com/shop/madisons

5) Similarly make the entries for other tokes from SEOTOKENUSGTYPE  table in SEOURL and SEOURLKEYWORD tables as required.

Fixed and Dynamic Tokens in SEO URL

1.Fixed tokens defined in pattern file(SEOURLPatterns.xml).
2.Dynamic Tokens defined in  SEOTOKENUSGTYPE table.

An SEO pattern file can contain two sections: A token is an elementary symbol in a URL pattern. Each token has a specific usage and is associated with a keyword and a value. During SEO-friendly URL construction, the tokens in a URL pattern are replaced by their respective keywords. During URL deconstruction, the keywords are looked up for their respective token names to match a particular URL pattern. The keywords are also looked up to find the values that are to be associated to the parameters of the deconstructed dynamic URL. There are two types of tokens: dynamic and fixed. Dynamic tokens are defined in the SEOTOKENUSGTYPE table, and the fixed tokens are defined in the pattern file(SEOURLPatterns.xml).

Let us see more on fixed tokens defined in Pattern file as below.

1 <seourl:token name="PageViewToken">
<seourl:tokenValue value="image"/>
<seourl:tokenValue value="detailed"/>

2 <seourl:token name="PrivacyRegistrationToken">
<seourl:tokenValue value="Privacy-Policy-Registration"/>
3 <seourl:token name="TopCategoryBooleanToken">
<seourl:tokenValue value="Y"/>
<seourl:tokenValue value="N"/>

4 <seourl:token name="BeginIndexToken">
<seourl:tokenValue value="[[0-9]*]"/>
5 <seourl:token name="CatEntryIDToken">
<seourl:tokenValue value="[[0-9]*]"/>
6 <seourl:token name="ContentOnlyToken">
<seourl:tokenValue value="1"/>
<seourl:tokenValue value="0"/>

1. PageViewToken
Can have only two values, image or detailed.
2. PrivacyRegistrationToken
Can have only a value of Privacy-Policy-Registration.
3. TopCategoryBooleanToken
Can have a value of Y or N.
4. BeginIndexToken
Can have numerical values. Enclose the expression in a set of brackets []. The expression [[0-9]*] indicates that the valid value for BeginIndexToken can be any numerical value. To use an integer, do not use the *.
5. CatEntryIDToken
Can have numerical values. Enclose the expression in a set of brackets []. The expression [[0-9]*] indicates that the valid value for CatEntryIDToken can be any numerical value. To use an integer, do not use the *.
6. ContentOnlyToken
Can have a value of 1 or 0. 
A value of 1 indicates to include header, footer, left and right navigation bar, along with content.
A value of 0 indicates to not include the header, footer, and left navigation bar. Display the content present at the middle of the page

Handling 301/404 redirects in SEO

Changing keyword in Management Center changes the URL but Old URLs still referenced by shoppers and search engines .
Solution to this is as follows.
Store replies with a 301 response with the new URL and redirects the browser .Page ranks are moved by search engines.Unused redirects removed with CleanSEOURL scheduled job.New database tables as  listed below has been introduced to handle this.

This table holds the old URL and new URL.
This table is used for checking traffic of redirect rule utilization.

When a business user changes the URL keyword for a product, category or static page in Management Center, the URL for that page in the store changes. When this happens, you do not want shoppers’ existing bookmarks to break and you do not want to lose your search engine page rank. 
To avoid these problems, a 301 redirect mapping is automatically generated between the old and new URL keywords for each language that is changed. Shoppers are automatically redirected to the new URL and search engine page ranks are moved to the new URL.The redirect mappings are stored in the database and cached for quick access upon initial use. Each mapping has a date associated with it tracking when the rule was last used. Once the date is past a configurable limit, a scheduler command, CleanSEOURL can be run to remove old mappings from the database and registry.

Title and metadata information for better ranking in internet using SEO

Title and metadata information is valuable for allowing your store's pages to have better  ranking. With the search engine optimization feature for WebSphere Commerce Version 7 Feature Pack 3, each web page in your store is provided with unique content to improve its ranking in search results.
The title and meta description data is comprised of: 

Page title
The page title appears in the customer's browser's title bar
Meta description
The meta description is used by search engines to provide a description of your site and the current web page's contents for a search results page. It is stored in the web pages HTML and is not viewable on the page itself.
Meta keyword
The meta keyword is used for your store's static pages such as the contact us or help page for search engines to accurately rank and index the web page. It is stored in the web page's HTML and is not viewable on the page itself.
Image alt text
Image alt text describes the contents of an image for search engines to accurately rank and index the image. It is viewable by hovering over the image on the web page and can be used for text to speech systems for the visually impaired.

The Title and metadata information  is defined as templates in the SEOPAGEDEF and SEOPAGEDEFDESC tables with the help of the SEO substitution parameters.Other tables w.r.t to the title and meta data  is SEOPAGEDEFOVR  and SEOPAGEDEFSUBPARAM.

This table holds the SEO page definition for a particular pageName at a site/store level.

This table holds the language specific title and meta description for a particular page definition.

This table holds the SEO page definition overrides defined for a particular catalogEntryID or catGroupID.
This table holds the predefined substitution parameters which can be used while creating the title and meta description. At run-time the substitution parameter will be replaced with the values based on the request properties.

Changing the SEO properties for categories and catalog entries in Management Center

In the Catalogs tool, tool, you can change the URL keyword, page title, meta description, and image alt text for catalog entry and category pages. 

1.Open Management center.
2.Select your store, then find and open the category or catalog entry that you want to modify its SEO properties for.
3.Click the Search Engine Optimization tab.
4.To change the URL keyword, type a new keyword.
5.To change the page title, meta-description or image alt text, click Override default for the property you want to change.
6.Enter the preferred content. For instance, the page title can be rewritten to be: "Welcome to the Aurora furniture department" for the furniture category page. If wanted, you can include any SEO substitution parameters.
7.Repeat for each property you want to change.
8.Click Save or Save and Close.

Substitution parameters for Search Engine Optimization (SEO)
When editing SEO properties for a category, catalog entry, or static page in Management Center, several SEO substitution parameters are available to use when overwriting the default title, meta description, meta keyword and alternative text for images description properties.

Note: Static pages are also referred to as content pages.Substitution parameters are useful for creating SEO properties for store pages, particularly category and catalog entry pages. They can be used when:
  1. Loading title and meta description templates into your store
  2. Changing SEO properties in Management Center
To insert an SEO substitution parameter, use the format: 

For example, to add the page title "Shop coffee-makers from Aurora" in the coffee maker category page: Shop <seo:CategoryName /> from <seo:StoreName />
If a substitution parameter is misspelled or references a substitution parameter that does not exist, it will appear as entered. For example, Shop coffee-makers from StoreName.If a substitution parameter is used for an incorrect page type, it will appear as entered.

The following table lists the available SEO substitution parameters in different pages:

Category Pages\CatalogEntry Pages\Static(Content )pages


Catalog entry pages

Caching for Performance (Data Caching)

Search engine optimized stores issue several queries to the SEOPAGEDEF, SEOPAGEDEFOVR, and SEOPAGEDEFDESC tables when a product is displayed.  These SEOPAGEDEF related query results should be cached for optimization.

A new optional object cache with JNDI nameservices/cache /WCSEOPageDefinitionDistributedMapCache is defined
in the sample cacheinstances.properties file, and two new logical data caches are defined and mapped to use it:


SEO Data Load
SEO dataload is supported in WebSphere Commerce V7 Fep5. It loads the SEO related tables SEOURL, SEOURLKEYWORD, SEOREDIRECT, SEOPAGEDEF, SEOPAGEDEFDESC, SEOPAGEDEFOVR. 


  1. Thank you for sharing valuable information. Nice post. I enjoyed reading this post. The whole blog is very nice found some good stuff and good information here Thanks..Also visit my page. optimia seo WebOptimiA is a 21st Century's Web Optimization provider company with a pioneer of providing WEB enabled services form last three year. We developed our own system for optimizing your campaign.

  2. Websphere commerce server Online Training, http://www.21cssindia.com/courses/webspere-commerce-server-online-training-200.html Websphere commerce server Online Training, Websphere commerce server Training, Websphere commerce server, Websphere commerce server Online Training| Websphere commerce server Training| Websphere commerce server| "Courses at 21st Century Software Solutions
    Talend Online Training -Hyperion Online Training - IBM Unica Online Training - Siteminder Online Training - SharePoint Online Training - Informatica Online Training - SalesForce Online Training - Many more… | Call Us +917386622889 - +919000444287 - contact@21cssindia.com
    Visit: http://www.21cssindia.com/courses.html"

  3. Really informative post, thank you for sharing this details to get more traffic in websites.SEO Serivce in delhi

  4. Hai, Is there any way to construct SEO Url in a java class in WCS ?

  5. Thanks for the great job. Url Structure is very basic thing to start a website. This is the primary thing to focus on. A good structure can help the indexation process of your website.

    To check your website structure, try free SEO tools

  6. This is just a basic and you can Google it to get complete details and ill update further details soon in between you can ask any question.backlinks

  7. I Will Provide SEO Blog Comment Service . & niche relevant blog comment service we provide a quality service with 100% Buyer satisfaction and My team Believed in Quality work not Quantity Contact me Now 24/7.check out this Blog for your business . your business will be gain 200% more profit I can not recommend you guys enough.

  8. It is nice one. Normally WebSphere Commerce server hosted or used for particular company for their customer. but this document combined SEO tips on WebSphere Commerce application is good one.


  9. Finding the time and actual effort to create a superb article like this is great thing. I’ll learn many new stuff right here! Good luck for the next post buddy..
    Digital Marketing Company in Chennai

  10. Great articles. This days i am also focus on <a href="http://www.ashimc.com/are-you-looking-for-the-seo-expert-in-nepal/>Internet marketing</a> it quite fun and kind of hard work to reach goal

  11. Selamat Telah Bergabung di ArtisQQ Anda Telah Terdaftar Pada Situs Yang Tepat. Dapatkan Milyaran Rupiah Bersama Partner Sejati Anda www.artisqq.com
    Bandar Poker
    Agen DominoQQ
    Agen BandarQ
    Bandar Poker Paling Terpercaya
    Agen AduQ
    Unyu Update
    Agen DominoQQ
    Agen DominoQQ
    Agen DominoQQ
    Agen DominoQQ
    Agen DominoQQ
    Agen DominoQQ

  12. Selamat Telah Bergabung di ArtisQQ Anda Telah Terdaftar Pada Situs Yang Tepat. Dapatkan Milyaran Rupiah Bersama Partner Sejati Anda www.artisqq.com
    Bandar Poker
    Agen DominoQQ
    Agen BandarQ
    Bandar Poker Paling Terpercaya
    Agen AduQ
    Unyu Update
    Agen DominoQQ
    Agen DominoQQ
    Agen DominoQQ
    Agen DominoQQ
    Agen DominoQQ
    Agen DominoQQ

  13. Thanks for sharing the post.. parents are worlds best person in each lives of individual..they need or must succeed to sustain needs of the family. internet marketing

  14. Great article, Really enjoyed the article. I will bookmark your blog and daily visit it for new articles.Thank you for this article and keep posting new articles.

  15. I think that thanks for the valuabe information and insights you have so provided here. search engine optimisation Adelaide

  16. Nice article ! Thanks for providing a vital information about SEO friendly URL.
    Top 100 High pr Classified sites 2017

  17. Great post! I am see the great contents and step by step read really nice information.I am gather this concepts and more information. It's helpful for me my friend. Also great blog here with all of the valuable information you have.
    Websphere Training in Chennai

  18. I read your blog and gain knowledge about on page technique. Thanks for Sharing very informative and valuable information...
    SEO Company in Nashik | Website design and development company

  19. I will do 35 niche blog comment .All comment relevant with your niche and UNIQUE .This off-page seo will increase your traffic and promote your business.

  20. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Android Training in Chennai
    Ios Training in Chennai

  21. Url with keywords is just a part of the seo. It can help but it is not the only factor which can rank your website and bring it in google search. It ads to the extra seo. Find more discussion regarding url seo at http://QuestionSignal.com.

  22. I am very inspired to read your post about digital marketing, it will be very helpful for all new learner to learn Digital marketing courses in pune.