Commerce Reference Store is configured to render on each page a link
tag that specifies the canonical URL for the page. When spiders for certain Web search engines crawl a page, they record the page’s URL as the value specified in the tag, rather than the actual URL that was used to access the page.
The link
tag for a page looks similar to this:
<link rel="canonical" ref="http://www.example.com:80/crs/storeus/jump/
Dotted-Repp-Tie/productDetail/For-Him/xprod1001/cat50067 " />
To code JSPs to render canonical URLs, Commerce Reference Store uses the URL recoding feature described in URL Recoding. The canonical URL generated for a page is similar to the static URL rendered for web spiders by an indirect URL template.
When a spider accesses a page using a dynamic URL (e.g., by following a link from another page), it sees (and records) the static URL it finds in the link
tag. When a user accesses a page using a static URL (e.g., by following a link recorded by a spider), the SEO jump servlet translates the static URL back to its dynamic equivalent for processing.
To render canonical URLs, Commerce Reference Store uses a servlet bean of class atg.projects.store.droplet.DocumentLinksDroplet
(a Commerce Reference Store-specific subclass of atg.repository.seo.CanonicalItemLink
). Commerce Reference Store includes a component of this class, /atg/store/droplet/DocumentLinksDroplet
, which includes the following configuration:
itemDescriptorNameToUrlTemplateMap=\
product=/atg/repository/seo/ProductIndirectTemplate,\
category=/atg/repository/seo/CategoryIndirectTemplate
The store.war/global/gadgets/documentLinks.jsp
gadget invokes the DocumentLinksDroplet
servlet bean to render the canonical URL for a product detail page. Note that documentLinks.jsp
uses the BrowserTyper
droplet to determine the browser type on the request, and creates the canonical link tag only if the browser type is robot
.