-->

How to change localhost URL in Hybris Sitemap XML

2019-09-02 10:52发布

问题:

I am trying to create a sitemap.xml for my Hybris site by going out of the box way and copying the ImpEx given in out of the box store in my site.impex.

How to change localhost URL in Hybris Sitemap XML?
The sitemap.xml generated after running the cronjob consists of multiple tags, which in turn contain the location of the different sitemap page types. Here in product and categories, most of the products and categories are visible, but the issue here is that they begin with localhost. Should this behavior be changed in higher environments? If so, how to do this?

How to add custom page URL to hybris sitemap?
Besides, in our pages, we have several content pages and also some custom pages, which do not feature there. How to add these in sitemap.xml?

回答1:

You need to configure site domains in local.properties config file.

website.my-site-id.http=http\://www.mydomain.com\:9001/
website.my-site-id.https=https\://www.mydomain.com\:9002/
media.my-site-id.http=http\://www.mydomain.com\:9001/
media.my-site-id.https=https\://www.mydomain.com\:9002/
asm.my-site-id.http=http\://www.mydomain.com\:9001/
asm.my-site-id.https=https\://www.mydomain.com\:9002/


回答2:

Should this behaviour be changed in higher environments?If so, how to do this?

Yes, you can configure below properties in your local.properties file according to your environments

website.mysite.http=http://www.yourDomain.com
website.mysite.https=https://www.yourDomain.com
media.mysite.http=http://www.yourDomain.com
media.mysite.https=https://www.yourDomain.com

here, replace mysite with your CMSSite id.
These properties internally used by getWebsiteUrlForSite & getMediaUrlForSite method of the DefaultSiteBaseUrlResolutionService


Besides,in our pages,we have several content pages and also some custom pages,which do not feature there.How to add these in sitemap.xml?

Go to HMC/backOffice > WCMS > WebSite > select your website > Right click on Site Map Configuration > Open in new tab.

Here, you can add custom URL in your SiteMapConfig and add Custom as Site Map Type Like

Site map type:Custom internally call CustomPageSiteMapGenerator which fetch the above configured custom URLs list