Page 1 of 1

Multi-site issue

Posted: 11 Oct 2019, 12:09
by adityabanerjee
Hi guys,

I am trying to set up the multisite by following the documentation. I created two multisite apart from default. Now I could toggle between the shops at the admin side properly. Let's say I have two multisites. One is named site1 and the other is site2. Now In the config/shop.php I have added -:


'routes' => [
// 'login' => ['middleware' => ['web']],
// 'admin' => ['prefix' => 'admin', 'middleware' => ['web']],
// 'jqadm' => ['prefix' => 'admin/{site}/jqadm', 'middleware' => ['web', 'auth']],
// 'extadm' => ['prefix' => 'admin/{site}/extadm', 'middleware' => ['web', 'auth']],
// 'jsonadm' => ['prefix' => 'admin/{site}/jsonadm', 'middleware' => ['web', 'auth']],
'jsonapi' => ['prefix' => '{site1}/jsonapi', 'middleware' => ['web', 'api']],
'account' => ['prefix' => '{site1}/profile', 'middleware' => ['web', 'auth']],
'default' => ['prefix' => '{site1}/shop', 'middleware' => ['web']],
// 'update' => [],
],

When I go to the mydomain/list page after adding these configurations, I am seeing error page 404. Please assist. I am using Laravel version 5.8*, Aimeos ~2018.07 and php 7.2.* on Mac os

Re: Multi-site issue

Posted: 11 Oct 2019, 12:17
by aimeos
It's only {site}, not {site1}

Re: Multi-site issue

Posted: 11 Oct 2019, 12:21
by adityabanerjee
Thank you for your response.

I have added the following in config/shop.php as suggested.

'routes' => [
// 'login' => ['middleware' => ['web']],
// 'admin' => ['prefix' => 'admin', 'middleware' => ['web']],
// 'jqadm' => ['prefix' => 'admin/{site}/jqadm', 'middleware' => ['web', 'auth']],
// 'extadm' => ['prefix' => 'admin/{site}/extadm', 'middleware' => ['web', 'auth']],
// 'jsonadm' => ['prefix' => 'admin/{site}/jsonadm', 'middleware' => ['web', 'auth']],
'jsonapi' => ['prefix' => '{site}/jsonapi', 'middleware' => ['web', 'api']],
'account' => ['prefix' => '{site}/profile', 'middleware' => ['web', 'auth']],
'default' => ['prefix' => '{site}/shop', 'middleware' => ['web']],
// 'update' => [],
],

Now I visit the same url i.e mydomain/list and I see the same error 404.

Re: Multi-site issue

Posted: 11 Oct 2019, 12:23
by aimeos
You use '{site}/shop', not '{site}/list', so your URL is "mydomain/shop"

Re: Multi-site issue

Posted: 11 Oct 2019, 12:28
by adityabanerjee
Thank you for your patience. I went to mydomain/shop but it is still showing 404.

Re: Multi-site issue

Posted: 11 Oct 2019, 12:38
by aimeos
Sorry, when you add {site} to your routes, the site code must be included in the URL.
In your case now: mydomain/site1/shop

Re: Multi-site issue

Posted: 11 Oct 2019, 12:44
by adityabanerjee
I face the same error when I go to mydomain/site1/shop and so does mydomain/site2/shop.

Re: Multi-site issue

Posted: 11 Oct 2019, 12:45
by aimeos
The locale site codes are named "site1" and "site2"? If not, replace "site1" in your URL with the real site code.

Re: Multi-site issue

Posted: 11 Oct 2019, 12:49
by adityabanerjee
So the site code I have added are syaanh and mzadqatar. In such a case, I tried to visit mydomain/syaanh/shop and mydomain/mzadqatar/shop both throw me 404.