0

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?

John Conde
  • 217,595
  • 99
  • 455
  • 496
Rachit
  • 403
  • 10
  • 32

2 Answers2

2

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/
mkysoft
  • 5,392
  • 1
  • 21
  • 30
  • @myskoft,thanks a lot for your answer.Really appreciate it.How to address the second point of fixing the content pages and custom pages not featuring? – Rachit Oct 21 '18 at 20:24
  • If your custom page developed in standard way (pages listed in CMS), it will included your sitemap. Otherwise you need custom development for sitemap. I suggest to fix custom page generation like hybris way. – mkysoft Oct 21 '18 at 20:48
  • @myskoft,thanks a lot for your answer.Really appreciate it.However,I saw that in my configuration: website.my-site-id.http=https://www.example.com website.my-site-id.https=https://www.example.com where my-site is the uid in CMSSite for my site.Where am I going wrong? – Rachit Oct 21 '18 at 20:49
  • @myksoft,the configuration parameters have the entry: website.mysite.http=https://www.example.com website.mysite.https=https://www.example.com where mysite is the uid of the CMSSite.If this configuration is correct,why isn't it relecting on the tag of – Rachit Oct 21 '18 at 21:25
  • The localhost coming was resolved by making a missing entry: media.my-site-id.http media.my-site-id.https – Rachit Oct 21 '18 at 22:31
1

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

enter image description here

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

HybrisHelp
  • 5,518
  • 2
  • 27
  • 65