I have created below sites: [PS: For security reason, i have not disclosed our actual domain name]
- Our Corporate Website Store
- Site created for one of our clients i.e. ABC
I have added below lines in .htaccess file in public_html/pub folder.
############################################## Enable rewrites
Options +FollowSymLinks
RewriteEngine on
SetEnvIf Host www\.magento2.ourdomain\.co.in MAGE_RUN_CODE=base
SetEnvIf Host www\.magento2.ourdomain\.co.in MAGE_RUN_TYPE=website
SetEnvIf Host ^magento2.ourdomain\.co.in MAGE_RUN_CODE=base
SetEnvIf Host ^magento2.ourdomain\.co.in MAGE_RUN_TYPE=website
SetEnvIf Host www\.abc.ourdomain\.co.in MAGE_RUN_CODE=abc
SetEnvIf Host www\.abc.ourdomain\.co.in MAGE_RUN_TYPE=website
SetEnvIf Host ^abc.ourdomain\.co.in MAGE_RUN_CODE=abc
SetEnvIf Host ^abc.ourdomain\.co.in MAGE_RUN_TYPE=website ################################################
I have also added below lines in .htaccess file in (root folder of magento) i.e. public_html folder
##########################################SetEnvIf Host abc.ourdomain.co.in* MAGE_RUN_CODE=abc
SetEnvIf Host abc.ourdomain.co.in* MAGE_RUN_TYPE=website
##########################################
On our cloud server we are using Centos 7.9.2009. I have added required host entries in extra.conf file in following folders:
/usr/local/apache/conf/userdata/std/2_4/abc/abc.ourdomain.co.in
/usr/local/apache/conf/userdata/ssl/2_4/abc/abc.ourdomain.co.in
The content of extra.conf is as below:
ServerName abc.ourdomain.co.in DocumentRoot /home/m2user/public_html/pub/
ServerAdmin my@email.id
UseCanonicalName Off
## User abc # Needed for Cpanel::ApacheConf
UserDir enabled m2user
# Enable backwards compatible Server Side Include expression parser for Apache versions >= 2.4.
# To selectively use the newer Apache 2.4 expression parser, disable SSILegacyExprParser in
# the user's .htaccess file. For more information, please read:
<IfModule mod_include.c>
<Directory "/home/m2user/public_html/pub/">
SSILegacyExprParser On
</Directory>
</IfModule>
<IfModule mod_suphp.c>
suPHP_UserGroup m2user m2user
</IfModule>
................
................
To customize the VirtualHost I have added below lines in
httpd.conf file of
Apache2for Port 80
# To customize this VirtualHost use an include file at the following location
Include "/etc/apache2/conf.d/userdata/std/2_4/abc/abc.ourdomain.co.in/*.conf"
and Port 443
# To customize this VirtualHost use an include file at the following location
Include "/etc/apache2/conf.d/userdata/ssl/2_4/abc/abc.ourdomain.co.in/*.conf"
In Magento 2 admin panel, required configuration is also done.
After restarting apache service, on visiting
https://abc.ourdomain.co.in link website is not opening and showing
"File Not Found" error.
I think I have followed all required steps to configure the multi store websites. But not sure where and what is going wrong?
Please guide me to get this resolved.