Multi-site issue

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
adityabanerjee
Posts: 10
Joined: 05 Oct 2019, 06:42

Multi-site issue

Post by adityabanerjee » 11 Oct 2019, 12:09

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

User avatar
aimeos
Administrator
Posts: 3311
Joined: 01 Jan 1970, 00:00

Re: Multi-site issue

Post by aimeos » 11 Oct 2019, 12:17

It's only {site}, not {site1}
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

adityabanerjee
Posts: 10
Joined: 05 Oct 2019, 06:42

Re: Multi-site issue

Post by adityabanerjee » 11 Oct 2019, 12:21

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.

User avatar
aimeos
Administrator
Posts: 3311
Joined: 01 Jan 1970, 00:00

Re: Multi-site issue

Post by aimeos » 11 Oct 2019, 12:23

You use '{site}/shop', not '{site}/list', so your URL is "mydomain/shop"
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

adityabanerjee
Posts: 10
Joined: 05 Oct 2019, 06:42

Re: Multi-site issue

Post by adityabanerjee » 11 Oct 2019, 12:28

Thank you for your patience. I went to mydomain/shop but it is still showing 404.

User avatar
aimeos
Administrator
Posts: 3311
Joined: 01 Jan 1970, 00:00

Re: Multi-site issue

Post by aimeos » 11 Oct 2019, 12:38

Sorry, when you add {site} to your routes, the site code must be included in the URL.
In your case now: mydomain/site1/shop
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

adityabanerjee
Posts: 10
Joined: 05 Oct 2019, 06:42

Re: Multi-site issue

Post by adityabanerjee » 11 Oct 2019, 12:44

I face the same error when I go to mydomain/site1/shop and so does mydomain/site2/shop.

User avatar
aimeos
Administrator
Posts: 3311
Joined: 01 Jan 1970, 00:00

Re: Multi-site issue

Post by aimeos » 11 Oct 2019, 12:45

The locale site codes are named "site1" and "site2"? If not, replace "site1" in your URL with the real site code.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

adityabanerjee
Posts: 10
Joined: 05 Oct 2019, 06:42

Re: Multi-site issue

Post by adityabanerjee » 11 Oct 2019, 12:49

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.

Post Reply