I have a site in my Hybris project having a URL pattern like:
localhost:9002/en-uk
Where the storefront context root was also kept as en-uk in mystorefront project.properties file.
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.
Should I change the storefront context root in mystorefront project.properties file as highlighted above?
If you have single storefront extension then your storefront context is common for all sites. So I would suggest keeping it as root (/). If you really want to have some storefront context 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) Set storefront context to root
/
to/hac
127.0.0.1 localhost us.local uk.local
In local.properties
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.
e.g.
UK CMSsite
US CMSsite
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
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.