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
Any pointers on what I've missed please?
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 :
Let me know what else is missing !
Also confirm if Base URL and Base Link URL (Secure and Unsecure) is different for every domain !
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.
Yes thanks, they are all set as they should be (except they're all https, I just redirect http to https in apache)
Turned out to be a typo in apache config, so magento wasn't picking up the MAGE_RUN* variables.
Thanks to all who responded.