How to direct localhost to mystorefront in hybris?

喜欢而已 提交于 2019-12-06 08:43:17

问题


Now when I go to https://localhost:9002/ it opens hac (hybris admin console).

When I go to https://powertools.local:9002/nystorefront/powertools/en/USD/cart I can reach my storefront.

I want to reach mystore when I go to localhost:9002.

What should I do?


回答1:


You have to configure webroot and storefrontContextRoot in local.properties file.

1) Add properties to your config/local.properties, change mystorefront (mystorefront.webroot) with your storefront name. Also, need to change hac webroot to /hac

hac.webroot=/hac  

mystorefront.webroot=
storefrontContextRoot=

2) To open your site without passing query parameter(?site=mysite), run the below Impex. Change mysite with your CMSSite name. This will also resolve your error(Cannot find CMSSite associated with current URL).

$siteUid=mysite       

# CMS Site                                                                                                 
INSERT_UPDATE CMSSite ; uid[unique=true] ; urlPatterns                                                                                                                  ;      
                      ; $siteUid         ; (?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=$siteUid)(|\&.*)$,(?i)^https?://$siteUid\.[^/]+(|/.*|\?.*)$,(?i)^https?://[^/].*$ ;



回答2:


I will assume your web extension name is mystorefront.

Add these into your config/local.properties

# This way hac extension will be available on https://localhost:9002/hac instead of https://localhost:9002/
hac.webroot=/hac  


# If you want to remap the context path to the root site on the web container
# then you must set these values to be blank, do not set them to be '/'
mystorefront.webroot=
storefrontContextRoot=

Also make sure that the urlPatterns associated with your CMSSite allow you to access your storefront via: https://localhost:9002/

You can also find this properties and additional information in your mystorefront/project.properties. As already mentioned there, "If you want to change these values then it is suggested that you override both of them in your config/local.properties file rather than changing the value here".



来源:https://stackoverflow.com/questions/50332540/how-to-direct-localhost-to-mystorefront-in-hybris

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!