Is it possible to run two Magento 2 websites on a single domain? I want to share the user between this websites. but want to redirect them to different stores (same URL - without store code) after they login based on their user group. That two store will be having same catalogs and identical store view.

I'm just doing this for separate user experience, like to make available different payment method, shipping and catalog visibility based on the user group, that is not available in magento base setup.

  • I have one question, How can I use a single user account for two different Magento. both have different db, how can I manage it? Is it possible? also if I added same customer details in both databases then is it possible to login automatically for both site? Jan 12 '19 at 10:29

here is the answer https://gist.github.com/thagxt/0f605f0a8a95c79302db0d2f04383788

we can create separate store in sub directory, so they run on same domain (no sub domain) and there is no need to make change in httpd or .htaccess


There's another way to do that, in Stores > Settings > Configuratio >web:

  1. Set your new site's url to that of the base_url(ex: www.website.com/)
  2. Set the option of 'add store Code in URLs' on.

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.