cancel
Showing results for 
Search instead for 
Did you mean: 

Second Site

SOLVED

Second Site

I have just installed Magento 2.1.3, with two sites. The first site loads fine (to the default home page), but the second site redirects to firstsite.com/index.php. 

 

I'm running nginx, and have configured the server block with $MAGE_RUN_TYPE and $MAGE_RUN_CODE -- I believe the run code is correct, because I get does-not-exist errors if I use nonsense code entries when running in developer mode. When using the correct code, the web browser sits for a second, then redirects to the default / first site. I disabled cache for my testing, and the access logs look like this:

 

[30/Dec/2016:05:21:07 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36"
[30/Dec/2016:05:21:10 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36"
[30/Dec/2016:05:21:13 +0000] "GET /index.php/ HTTP/1.1" 200 13882 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36"

...

followed by the normal load of the firstsite.com/index.php page.

 

Does anyone know why the second site doesn't load?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Second Site

@Damian Culotta Thanks for the response -- I think I have determined the cause. I set the URLs in the Web Site, but left the default of "use website" in the Store View section. My understanding is that this should have taken the values of the Web Site URL from the web site it was under, but it does not seem to. Instead it takes the settings from the Default Config section. When I override the values at both the Website and Store View level, it behaves as it should.

 

Seems bug-like to me so I will see if it has already been filed...

 

UPDATE: Looks like https://github.com/magento/magento2/issues/7970 and possibly https://github.com/magento/magento2/issues/7815

View solution in original post

2 REPLIES 2

Re: Second Site

Hi @bwern,

 

Did you tried with the sample configuration? https://github.com/magento/magento2/blob/2.1.3/nginx.conf.sample

Can you share you nginx host file?

Re: Second Site

@Damian Culotta Thanks for the response -- I think I have determined the cause. I set the URLs in the Web Site, but left the default of "use website" in the Store View section. My understanding is that this should have taken the values of the Web Site URL from the web site it was under, but it does not seem to. Instead it takes the settings from the Default Config section. When I override the values at both the Website and Store View level, it behaves as it should.

 

Seems bug-like to me so I will see if it has already been filed...

 

UPDATE: Looks like https://github.com/magento/magento2/issues/7970 and possibly https://github.com/magento/magento2/issues/7815