Hi Magento Community,
We have setup Magento project in Magento cloud commerce with version 2.2.2. We created another website, store and store view in the same Magento instance to use the multi-website concept.
We followed the article on this page: https://devdocs.magento.com/guides/v2.2/cloud/project/project-multi-sites.html
Now, when we try to browse the subdomain/second store, it's getting redirected to the main website store.
When we try to debug, the echo die is not working in the index file.
What could be the issue? Please guide.
@Gideon BabuConnect with the cloud support for the help. You may be missing an entry in an YAML file which can only be updated by Cloud support or Fastly need some adjustment. Cloud support can resolve it much quicker.
Thanks for your reply Tharandeep.
Yes, I have added few lines of code in magento-vars file.
if (isHttpHost("example.")) { $_SERVER["MAGE_RUN_CODE"] = "example"; $_SERVER["MAGE_RUN_TYPE"] = "store"; }
I got it working now by changing the value from
if (isHttpHost("example.domain.com")) {
to
if (isHttpHost("example.")) { // just the subdomain code and dot to represent the subdomain
// kept the return as it is like the one below:
return strpos(str_replace('---', '.', $_SERVER['HTTP_HOST']), $host) === 0;