My Magento version is 2.2.6. In our shop, we need multiple websites and stores both. The store level is working fine, but there is a problem when visiting website level link. It gets always redirect to the default website. Can anyone help me? Thanks!

Below is my nginx/vhost conf:

This is set as default website in admin panel

This is another store,It's working fine

enter image description here

When visiting store level domain "thirdview.magento2.com", it is working fine, but when visiting the website level domain "test4website.magento2.com", it always redirects to "my.magento.com"--the default domain.

In addition, all domain were worked properly when I set the "test4website.magento2.com" as the default website,why is that? Can anyone please help me out?

1 Answer 1


We had similar problem on store setup we were working on. It was just one problem install. I was going to type up a reply but spotted that someone has also experienced similar problem in earlier version of magento.

Take a look at this


Although in the end we just edited index.php

Didn't bother with setting codes in nginx

It's not a great answer but sometimes we just need to get the job out the door right?

  • Thanks very much
    – lin
    Jun 6, 2019 at 1:04
  • Ran to same problem on 2.4.5-p1. Setting up 5 multi websites, 4 kept redirecting to the first site with 1st virtualhost file in nginx/sites-available. The solution above works but not the best solution. Multi Store Instruction for nginx from Adobe is not working (at least in my case)
    – Long Le
    Dec 30, 2022 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.