Listen 1808
<VirtualHost 127.0.0.1:1808>
ServerName demo.lo
DocumentRoot "C:/work/mage2.pro"
SetEnv MAGE_MODE "developer"
SetEnv MAGE_RUN_TYPE "website"
SetEnv MAGE_RUN_CODE "demo_lo"
RemoteIPHeader X-Forwarded-For
</VirtualHost>
Listen 1814
<VirtualHost 127.0.0.1:1814>
ServerName shoes.lo
DocumentRoot "C:/work/mage2.pro"
SetEnv MAGE_MODE "developer"
SetEnv MAGE_RUN_TYPE "website"
SetEnv MAGE_RUN_CODE "shoes_lo"
RemoteIPHeader X-Forwarded-For
</VirtualHost>
Do they need to be declared in the Apache config file?
Can one set them in .htaccess or index.php?
Of course, you can set the MAGE_RUN_CODE
and MAGE_RUN_TYPE
parameters through the root’s .htaccess
or even through the root’s index.php
, but both these files are from the Magento 2 distributive and will be overwritten by a system update, so I recommend to set these parameters in a webserver configuration file.