Magento2: Issue with multi website URL

Created on 15 Dec 2016  路  24Comments  路  Source: magento/magento2


Preconditions


  1. Magento 2.1.3

Steps to reproduce

  1. Create Multi Website and multi stire
  2. Set Url for Second website
  3. Set Url for Second website Store (Check Use Website)

Expected result

  1. Second website Store url should be Second website URL after Check Use Website Url

Actual result

  1. Second website Store url is using main site url after Check Use Website Url

bug report

Most helpful comment

We are using Apache server. This issue occurs after upgrade from 2.1.2=>2.1.3

All 24 comments

i have same problem , i got 2 domains that ref to deterrent store views be .htaccess
like this :
SetEnvIf Host .kushies. MAGE_RUN_CODE=kushies_he
SetEnvIf Host .kushies. MAGE_RUN_TYPE=store
SetEnvIf Host .aquaview. MAGE_RUN_CODE=aquaview_he
SetEnvIf Host .aquaview. MAGE_RUN_TYPE=store

i also try to follow the guide : http://devdocs.magento.com/guides/v2.0/config-guide/multi-site/ms_over.html
without success ..

We are using Apache server. This issue occurs after upgrade from 2.1.2=>2.1.3

I have same problem. After upgrade to 2.1.3, I can't use multiple domain name for store view scope.

Hello,
I can confirm that issue.
Before upgrade from 2.1.2 to 2.1.3 my Multi-Store setup has worked.
It is configured like this: Subdomain1.domain.com and Subdomain2.domain.com
Now Subdomain2.domain.com redirects to the Main-Store (Subdomain1.domain.com).

It looks like magento does not note at my /etc/httpd/....../.conf file the following lines:
SetEnv MAGE_RUN_CODE "XYZBLA"
SetEnv MAGE_RUN_TYPE "website"

Maybe the variables changed?

#

Also everybody please note that the update overrides the .htaccess. My mod deflate options were lost and I had to insert them again.

My guess, here is a related issue https://github.com/magento/magento2/issues/7840

Same issue any news about ?

Need to confirm if this is really a Magento 2.1.3 bug because two sumdomains are down afther upgrading from from 2.1.2 to 2.1.3 just works fine in main domain.

@salelsol I would say it is a bug and it's related to #7841. It would seem that store fallback and theme fallback now work a bit differently, It works perfectly fine in 2.1.2.

Do you think best solution is revert to Magento 2.1.2 ? or maybe this bug will be fixed early in future 2.1.4 release.

I reverted to 2.1.2

So did I. I'm trying to dig around and see where the breaking code is. I'll keep you posted.

I'd rather wait because I just made some changes to some extensions installed to be compatible with magento 2.1.3 and if I revert then will be lost.

Guys, please check workaround here https://github.com/magento/magento2/issues/7840 and tell if it works for you. This fixed the configuration retrieving from the website scope for me.

Fixed with @alexpoletaev help.
First change line $code = $website['website_id']; should be replaced with $code = $website['code'];
in vendor/magento/module-store/Model/Config/Processor/Fallback.php and afther modify your .htaccess

Thanks to @alexpoletaev
Your solution worked for me. Just edit the line of code and clear the cache.

@salelsol
What did you modified in your .htaccess? I haven't modified anything and it worked.

@Yunus260 You must modify .htaccess when you install magento 2.1.3 afther run: php bin/magento setup:upgrade

I experienced this issue after upgrading a multi-website install from 2.1.2 to 2.1.3. I had my "Base Url" and "Secure Base Url" values configured at the Website scope. I switched the values to be stored at the Store View scope, and that fixed my problem.

@salelsol I still do not understand what you mean with "You must modify .htaccess.."
After install or upgrade there is nothing that has to be modified in .htaccess which is significant for multi-domain. Please be more clear.

@Yunus260 Your .htaccess start with this line ?

All explanations you could find in .htaccess.sample file

If Yes you are Magento 2.1.3 .htaccess file right
If Not you would be modify from fresh .htaccess file

Yunus260 Magento 2.1.3 .htaccess started :

All explanations you could find in .htaccess.sample file

DirectoryIndex index.php

php_value memory_limit 768M
php_value max_execution_time 18000
php_flag session.auto_start off
php_flag suhosin.session.cryptua off

@salelsol I used the Admin-Backend to upgrade from 2.1.2 to 2.1.3 and that upgrade has updated my .htaccess, like mentioned above.
My .htaccess now looks like this:
https://github.com/magento/magento2/blob/2.1.3/.htaccess

Thats why I wrote " I haven't modified anything and it worked."
I do not know why your .htaccess has not been updated.

@Yunus260 I use ssh command line to upgrading all new Magento versions and then I must manually add properly line to redirect to subdomains. I this version .htaccess is quite different from previous version so I have referred to that .htaccess file.

Hi @netzweltvimal, this issue was fixed under MAGETWO-62648 in 2.1.4, that's why I closed it. If you have additional questions or info please feel free to reopen this one or create a new one.

I know I have an old version but I have the same issue in version 2.1.18.
I have 2 shops (with different base urls in magento admin settings) and 4 views.
url1.com/store_code1
url1.com/store_code2
url2.com/store_code3
url2.com/store_code4
If I try to get them by those links it works fine but if I don't add store code the system thinks it is store_code1 with base url1 even I open url2.com (it redirects to url1.com)
Please help.

Was this page helpful?
0 / 5 - 0 ratings