Sunday, June 14, 2015

SEO URLs in WCS


   When it comes to generating SEO URLs, there are mainly 2 things we need to give focus on. One is removing dynamic attributes (? ,= , & etc) from the URL and another one is shortening the url.

In the earlier versions of WCS, it was relying only on configuration files to support SEO URLs. From Websphere Commerce Server 7 Feature pack 3 onwards, we can also maintain SEO URL related data in 2 OOB tables named SEOURL and SEOURLKEYWORD. The keywords mentioned in this table will be used to construct SEO URLs. The configurations mentioned in SEOURLPatterns.xml will be used for the same.

The data can loaded in to these new tables by using seourlkeywordgen utility or it can be loaded along with data load process by configuring loadSEO property as true.

URL Shortening can be done by modifying the following files.

1. httpd.conf
2. wc-server.xml

Httpd.conf:

The following rewrite rule can be added to map the shortened URLs to WCS specific URLs.

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

wc-server.xml:

The SEOConfiguration section in wc-server.xml needs to be modified to change the context root value.

 <SEOConfiguration defaultUrl="" dynamicUrl="true" enable="true">
        <context-root-rewrite value="/" />
 </SEOConfiguration>

To handle 404 and 301 redirects, WCS is also maintaining a table named SEOREDIRECT.

No comments:

Post a Comment