Hybris的多个国家/地区站点 [英] Multi country site in Hybris

查看:99
本文介绍了Hybris的多个国家/地区站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Hybris项目中有一个网站,其网址格式如下:

I have a site in my Hybris project having a URL pattern like:

localhost:9002/en-uk

在mystorefront project.properties 文件中,店面上下文根也保留为en-uk.

Where the storefront context root was also kept as en-uk in mystorefront project.properties file.

如何将其扩展到其他国家/地区并为我的新国家/地区创建一个新站点.我尝试更改现有站点的impex并在那里更改URL,但没有产生任何效果.

How do I extend this for other countries and create a new site for my new country.I tried changing the existing site impex and changing the URL there but it did not yield anything.

是否应该如上所述在mystorefront project.properties 文件中更改店面上下文根?

Should I change the storefront context root in mystorefront project.properties file as highlighted above?

推荐答案

如果您具有单个店面扩展,那么您的店面上下文对于所有站点(CMSSite)都是通用的.我建议将其保留为根(/).如果您确实希望在站点URL中具有店面上下文,请使其保持通用.不要包含国家/地区代码,因为当有人使用/en-uk访问美国网站时,这是没有意义的.

If you have a single storefront extension then your storefront context is common for all sites (CMSSite). I would suggest to keep it as root (/). If you really want to have a storefront context in the site URL then keep it generic. Do not include countries/language code as it doesn't make sense when someone accesses the US site with /en-uk.

  1. 将HAC Webroot从/更改为/hac
  2. 设置店面网络根& StorfrontContextRoot为空白
  3. 更改网站和每个cmsStore的媒体URL
  4. 127.0.0.1 localhost us.local uk.local
  5. 创建主机文件条目
  1. Change HAC webroot from / to /hac
  2. Set your storefront webroot & StorfrontContextRoot to blank
  3. Change website & media URL for each cmsStore
  4. Make host file entry for 127.0.0.1 localhost us.local uk.local

local.properties

hac.webroot=/hac

#change <yourproject> with your storefront extension prefix
<yourproject>storefront.webroot=

#If you are using B2C then below propery would be StorefrontContextRoot
b2bStorefrontContextRoot=

#change usCMSSiteUI with your us CMS site uid and similar for UK
website.usCMSSiteUID.http=http://us.local:9001
website.usCMSSiteUID.https=https://us.local:9002
media.usCMSSiteUID.http=http://us.local:9001
media.usCMSSiteUID.https=https://us.local:9002

website.ukCMSSiteUID.http=http://uk.local:9001
website.ukCMSSiteUID.https=https://uk.local:9002
media.ukCMSSiteUID.http=http://uk.local:9001
media.ukCMSSiteUID.https=https://uk.local:9002


2)为每个CMSSite配置唯一的URL模式

希望每个站点都有CMSSite实例.对于每个站点,您都必须配置URL模式.


2) Configure each CMSSite with the unique URL pattern

Hope you already have CMSSite instance for each site. For each site, you have to configure the URL pattern.

例如

英国CMSsite

(?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=UK)(|\&.*)$
(?i)^https?://uk\.local:9002$

美国CMS网站

(?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=US)(|\&.*)$
(?i)^https?://us\.local:9002$


3)启动服务器并访问它

如果您如上所述正确配置了站点,则可以按以下方式访问它


3) Start your server and access it

If you have configured your sites correctly as I mentioned above, then you can access it like

https://us.local:9002 https://uk.local:9002

对于生产设置,您可以为每个站点URL模式配置(子)域,或者通过传递?site = us uk .

For production setup, you can configure (sub-)domains for each site URL patter or take help of web server to resolve requests by passing ?site=us or uk.

这篇关于Hybris的多个国家/地区站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆