Good question. I might do video on this… one day.
So, it seems like you have already done most of the heavy lifting
I’ve not tested this in Magento 2, but I’m pretty sure it would work this way:
Example of Stores Setup
Example of Apache Config File 1 (Port 80)
<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName exampleone.com
SetEnv MAGE_RUN_TYPE "exampleone"
SetEnv MAGE_RUN_CODE "english"
</VirtualHost>
Example of Apache Config File 2 (Port 80)
<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName exampletwo.com
SetEnv MAGE_RUN_TYPE "exampletwo"
SetEnv MAGE_RUN_CODE "english"
</VirtualHost>
Therefore, Apache would check what URL the visiting was trying to access (exampleone.com
or exampletwo.com
)… Then reroute the connection to the specific Web Site / Store View
Magento Official Documentation:
MAGE_RUN_TYPE
can be eitherstore
orwebsite
- Use
website
to load a website in your storefront.- Use
store
to load any store view in your storefront.MAGE_RUN_CODE
is the unique website or store view code that corresponds toMAGE_RUN_TYPE
If it doesn’t work, it’ll be a few days before I get a chance to try this myself. Let us know how you get on.