Custom domain for each sites

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
AmzoooJibal
Posts: 35
Joined: 12 Mar 2021, 20:09

Custom domain for each sites

Post by AmzoooJibal » 12 Mar 2021, 20:19

Hello,
i have installed aimeos in xampp in local machine, then I have created a site with this commande: php artisan aimeos:setup seller1.com

i have configured my host and vhots like this:

host:

Code: Select all

127.0.0.1       www.seller1.com
vhost:

Code: Select all

<Directory "D:/aimeos/myshop/public">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order Deny,Allow
        Allow from all
        Require all granted
</Directory>

<VirtualHost *:80>
    DocumentRoot D:/aimeos/myshop/public
    ServerName www.seller1.com
</VirtualHost>
but when I access to the url:www.seller1.com i have the default marketplace not the seller1
any help please ?

User avatar
AmzoooJibal
Posts: 35
Joined: 12 Mar 2021, 20:09

Re: Custom domain for each sites

Post by AmzoooJibal » 13 Mar 2021, 12:33

my conf/shop.php is like this:

Code: Select all

<?php

$routes = [];

if( config( 'app.shop_multishop' ) || config( 'app.shop_registration' ) ) {
	$routes = ['routes' => [
		'admin' => ['prefix' => 'admin', 'middleware' => ['web', 'verified']],
		'jqadm' => ['prefix' => 'admin/{site}/jqadm', 'middleware' => ['web', 'auth', 'verified']],
		'jsonadm' => ['prefix' => 'admin/{site}/jsonadm', 'middleware' => ['web', 'auth', 'verified']],
		'jsonapi' => ['prefix' => 'jsonapi/{site}', 'middleware' => ['web', 'api']],
		'account' => ['prefix' => 'profile/{site}', 'middleware' => ['web', 'auth']],
		'default' => ['prefix' => 'shop/{site}', 'middleware' => ['web']],
		'update' => ['prefix' => '{site}'],
	] ];
}


return $routes + [

	'apc_enabled' => false, // enable for maximum performance if APCu is availalbe
	'apc_prefix' => 'aimeos:', // prefix for caching config and translation in APCu
	'pcntl_max' => 4, // maximum number of parallel command line processes when starting jobs

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

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

Re: Custom domain for each sites

Post by aimeos » 13 Mar 2021, 16:07

First, "www.seller1.com" is not the same as "seller1.com"!

To configure custom domain routing read:
https://aimeos.org/docs/latest/laravel/ ... he-routing
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
AmzoooJibal
Posts: 35
Joined: 12 Mar 2021, 20:09

Re: Custom domain for each sites

Post by AmzoooJibal » 13 Mar 2021, 18:16

Hello,
i hve read this link many times and i have added this to my config/shop.php :

Code: Select all

<?php

$routes = [];

if (config('app.shop_multishop') || config('app.shop_registration')) {
    $routes = [
        'routes' => [
            'admin' => ['prefix' => 'admin', 'middleware' => ['web', 'verified']],
            'jqadm' => ['prefix' => 'admin/{site}/jqadm', 'middleware' => ['web', 'auth', 'verified']],
            'jsonadm' => ['prefix' => 'admin/{site}/jsonadm', 'middleware' => ['web', 'auth', 'verified']],
            'jsonapi' => ['prefix' => 'jsonapi/{site}', 'middleware' => ['web', 'api']],
            'account' => ['prefix' => 'profile/{site}', 'middleware' => ['web', 'auth']],
            'default' => ['prefix' => 'shop/{site}', 'middleware' => ['web']],
            'update' => ['prefix' => '{site}'],
        ]
    ];
}


return $routes + [

        'apc_enabled' => false, // enable for maximum performance if APCu is availalbe
        'apc_prefix' => 'aimeos:', // prefix for caching config and translation in APCu
        'pcntl_max' => 4, // maximum number of parallel command line processes when starting jobs

        'routes' => [
            // Docs: https://aimeos.org/docs/Laravel/Custom_routes
            // Multi-sites: https://aimeos.org/docs/Laravel/Configure_multiple_shops
            'admin' => ['domain' => '{site}', 'prefix' => 'admin', 'middleware' => ['web']],
            'jqadm' => ['domain' => '{site}', 'prefix' => 'admin/jqadm', 'middleware' => ['web', 'auth']],
            'jsonadm' => ['domain' => '{site}', 'prefix' => 'admin/jsonadm', 'middleware' => ['web', 'auth']],
            'jsonapi' => ['domain' => '{site}', 'prefix' => 'jsonapi', 'middleware' => ['web', 'api']],
            'account' => ['domain' => '{site}', 'prefix' => 'profile', 'middleware' => ['web', 'auth']],
            'default' => ['domain' => '{site}', 'prefix' => 'shop', 'middleware' => ['web']],
            'update' => ['domain' => '{site}'],
        ],
......
and also activate multistore:

Code: Select all

SHOP_MULTISHOP=true
SHOP_REGISTRATION=true
and i have just installed new version and test all this domains:

Code: Select all

php artisan aimeos:setup http://www.seller1.com
php artisan aimeos:setup www.seller1.com
but allways i have the default store with demo article, my question where is the www.seller1.com store ? why when i access www.seller1.com the default store is shown ?
Thanks for your help

User avatar
AmzoooJibal
Posts: 35
Joined: 12 Mar 2021, 20:09

Re: Custom domain for each sites

Post by AmzoooJibal » 13 Mar 2021, 21:15

ok i found the problem, it's not verry calire in documentaion so i have changed:

Code: Select all

'default' => ['domain' => '{site}', 'prefix' => 'shop', 'middleware' => ['web']],
to 'default' => ['domain' => '{site}', 'prefix' => '', 'middleware' => ['web']],
and now its working

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

Re: Custom domain for each sites

Post by aimeos » 14 Mar 2021, 14:59

If you enable one or both of these settings

Code: Select all

SHOP_MULTISHOP=true
SHOP_REGISTRATION=true
you also need to change the route config in the if-block, not in the block that's part of the return statement.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
deepstyle
Posts: 2
Joined: 26 Mar 2021, 12:52

Re: Custom domain for each sites

Post by deepstyle » 05 May 2021, 04:48

AmzoooJibal wrote: 13 Mar 2021, 12:33 my conf/shop.php is like this:

Code: Select all

<?php

$routes = [];

if( config( 'app.shop_multishop' ) || config( 'app.shop_registration' ) ) {
	$routes = ['routes' => [
		'admin' => ['prefix' => 'admin', 'middleware' => ['web', 'verified']],
		'jqadm' => ['prefix' => 'admin/{site}/jqadm', 'middleware' => ['web', 'auth', 'verified']],
		'jsonadm' => ['prefix' => 'admin/{site}/jsonadm', 'middleware' => ['web', 'auth', 'verified']],
		'jsonapi' => ['prefix' => 'jsonapi/{site}', 'middleware' => ['web', 'api']],
		'account' => ['prefix' => 'profile/{site}', 'middleware' => ['web', 'auth']],
		'default' => ['prefix' => 'shop/{site}', 'middleware' => ['web']],
		'update' => ['prefix' => '{site}'],
	] ];
}


return $routes + [

	'apc_enabled' => false, // enable for maximum performance if APCu is availalbe
	'apc_prefix' => 'aimeos:', // prefix for caching config and translation in APCu
	'pcntl_max' => 4, // maximum number of parallel command line processes when starting jobs

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

User avatar
deepstyle
Posts: 2
Joined: 26 Mar 2021, 12:52

Re: Custom domain for each sites

Post by deepstyle » 05 May 2021, 04:49

Hi
I have installed amieos but I am not able to do this multitenant settings can you help Mr I am ready to pay you

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

Re: Custom domain for each sites

Post by aimeos » 05 May 2021, 05:20

If you need paid support, the Aimeos company offers it:
https://aimeos.com/support
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply