- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Magento 2.2.2 Cloud EE Multisite in subdomain keep redirecting to main website domain
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.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2.2.2 Cloud EE Multisite in subdomain keep redirecting to main website domain
@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.
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2.2.2 Cloud EE Multisite in subdomain keep redirecting to main website domain
Thanks for your reply Tharandeep.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2.2.2 Cloud EE Multisite in subdomain keep redirecting to main website domain
You need to add your code here.
Magento 2 Blogs/Tutorial
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2.2.2 Cloud EE Multisite in subdomain keep redirecting to main website domain
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;