Tag Archives: Websites

Magento 2 Setup Multiple Websites

Follow the below steps to configure multiple magento websites

1) Create websites, stores, and store views in the Magento Admin

2) Create Apache virtual hosts.

Edit the file E:\xampp\apache\conf\extra\httpd-vhosts.conf

<VirtualHost *:80>
 ServerName phpcode.com
 DocumentRoot E:\xampp\htdocs\phpcode\pub

<VirtualHost *:80>
 ServerName in.phpcode.com
 DocumentRoot E:\xampp\htdocs\phpcode\pub
 SetEnv MAGE_RUN_CODE "india"
 SetEnv MAGE_RUN_TYPE "website"

3) Restart Apache.

4) Edit your vhost file(In my system its C:\Windows\System32\drivers\etc\hosts) phpcode.com in.phpcode.com

5) Verify the sites accessing the following URLs