Showing results for 
Search instead for 
Did you mean: 

Magento2 multiwebsite redirection issue

Magento2 multiwebsite redirection issue



I have a site of magento version 2.2.1 which runs two different websites having different domains. When I try to upgrade its magento version from 2.2.1 to any higher version through composer then I get redirection issue ie when I try to run second website then it redirects me on default website.

Also, there is no virtual symlinks to manage multiwebsites. So, how is it possible to run two websites in magento with two different domain using any magento settings and this settings remove after upgrading magento version.

I've also compared core_config_data table and there is no change in this table that can be cause of this issue.



Re: Magento2 multiwebsite redirection issue

Hello @vivek1910


are you using the same db?


If yes then add thing into apache2 site available 


<VirtualHost *:8080>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/pub
		SetEnv MAGE_RUN_CODE "orange" // your site code
		SetEnv MAGE_RUN_TYPE "website" // your site
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /var/www/html/>
               # AuthType Basic
               # AuthName "Restricted Content"
               # AuthUserFile /etc/apache2/.htpasswd
               # Require valid-user
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all

hope it will help you.