Develop > Presentation layer > Search engine optimization (SEO) > WebSphere Commerce integration with sitemaps > Customize sitemaps integration
Sitemaps integration template
The Sitemap.jsp file is used to generate all of the URLs that to be indexed by a search engine, such as Google. It will generate It is located under each stores root for which you have generated a sitemap for example, WC_EAR /Stores.war.
The Sitemap.jsp file takes a storeId, and optionally a list of catalog IDs as its parameter, and generates URLs that access all the categories and catalog entries of the store, in all of the languages supported by the store. The sitemap.jsp files provided are samples based on the URLs in the ConsumerDirect and AdvancedB2BDirect starter stores only. You can add or update any URLs in these files as long they conform with the Sitemap Protocol v0.9.
If you have customized your store, and have to create the own Sitemap.jsp file, adhere to the following conventions outlined in the Sitemap Protocol v0.9:
- The Sitemap.jsp file must be encoded in UTF-8.
- Each URL has to be absolute such as http://example.com.
- W3C Date and time formats must be used such as YYYY-MM-DD.
- All URLs should be properly escaped using entity escape codes, and follow the RFC-3986 standard for URIs, the RFC-3987 standard for IRIs, and the XML standard.
- The generated sitemap does not contain URLs that start with HTTPS protocol. URLs starting with https are ignored if they are in a sitemap whose URL starts with http, and vice versa. For example, if the sitemap is under http://example.com, then any URL that starts with https://example.com in the sitemap is ignored. In order to avoid incomplete crawling, only list one type of URL.
- If the catalogId's are not passed by the command, the master catalog for the store is used to generate the URLs. In the following example the catalogId's are provided, and the sitemap is generated using the URLs of the pages in those catalogs.
/Sitemap.jsp?storeId=10101&catalogIds=10101,10151&hostName=chutes.torolab.ibm.comWhere:
- storeId_i
- The ID of the store for which the sitemap is generated, such as 10101.
- catalogId_i
- The catalogId for a store with storeId_i. Multiple values can be provided for the same i, such as catalogId_i=value1&catalogId_i=value2
- hostname
- The host name of the production server later used to host the sitemap.xml files. This parameter is required when the command is executed on a staging server and the sitemap.xml file is to be hosted on a production server. The host name must be in the form name.domain .
The following example displays a sample XML file generated by Sitemap.jsp:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.example.com/</loc> <lastmod>2005-01-01</lastmod> </url> </urlset>
Where:
- <loc>
- URL of the page. All the URLs that the merchants want to be indexed by Google search engine. The following views are to be included in the sitemap for WebSphere Commerce:
- TopCategoriesDisplay
- CategoryDisplay: the URLs for CategoryDisplay are generated for each top category and subcategory.
- ProductDisplay: the URLs for ProductDisplay are generated for each product, item, bundle, and package.
- PrivacyView
- ContactView
- HelpView
- <lastmod>
- The date the JSP page was modified last. For the CategoryDisplay page, the field LASTUPDATE of the table CATGROUP can be used as the last modification date. For the ProductDisplay page, the field LASTUPDATE of the table CATENTRY can be used as the last modification date.
Related concepts
WebSphere Commerce integration with sitemaps
Related tasks
Customize sitemaps integration