cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get multiple websites/stores to work

Can't get multiple websites/stores to work

Hi,

 

I've done everything it said in the docs (I think) to set up multiple websites/stores (Magento 2.4.1). I'm building a few test shops to learn. I cannot get the different websites/stores to work. After the first request I can see in the devtools console that the page is requesting items from the main website domain rather than the correct one.The main menu categories are the same as the main website too (I have different categories set up for different websites).

 

I've changed all the base URLs where appropriate, and configured virtual hosts in Apache (with MAGE_RUN_TYPE=website and MAGE_RUN_CODE=code environment variables).

Each website has one store and each of those stores has one store view.

 

Here's the setup:

Main website: https://dev.shop.themapps.com

Other websites: https://dev.pens.shop.themapps.com and https://dev.billiards.shop.themapps.com.

 

Any pointers on what I've missed please?

6 REPLIES 6

Re: Can't get multiple websites/stores to work

Hello @kevin_porter 

 

As I can check, all store views are working fine on different domains, what else is missing ?
if you aren't ensure if working differently, just change the theme of any store view and deploy again.

Also I can see that menu bar items still going to the main domain, but with different domains also working fine for ex :

https://dev.billiards.shop.themapps.com/category-3.html

https://dev.pens.shop.themapps.com/category-3.html

https://dev.shop.themapps.com/category-3.html

 

Let me know what else is missing !

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: Can't get multiple websites/stores to work

Also confirm if Base URL and Base Link URL (Secure and Unsecure) is different for every domain !

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: Can't get multiple websites/stores to work

The category links should be going to individual sites though, not the main website?

See the broken images too, eg the search icon and cart/trolley icon in the search widget - they are referencing the main website not the pens and billiards domains.

 

Also, the 'category 1', 'category 2' and 'category 3' are only on the default store of the main website. I've set up different categories on the other sites but they still show the default store categories.

Re: Can't get multiple websites/stores to work

Yes thanks, they are all set as they should be (except they're all https, I just redirect http to https in apache)

Re: Can't get multiple websites/stores to work

Turned out to be a typo in apache config, so magento wasn't picking up the MAGE_RUN* variables.

 

Thanks to all who responded.

Re: Can't get multiple websites/stores to work


walgreenslistens@kevin_porter wrote:

The category links should be going to individual sites though, not the main website?

See the broken images too, eg the search icon and cart/trolley icon in the search widget - they are referencing the main website not the pens and billiards domains.

 

Also, the 'category 1', 'category 2' and 'category 3' are only on the default store of the main website. I've set up different categories on the other sites but they still show the default store categories.


Many thanks for that complete information!