0

I'm having some trouble configuring a multi-site setup for my employer's website.

Our server provider has setup two seperate domains running off the same server and webroot.

I have completed all the requisite steps in the Magento admin panel.

However, when I proceeded to editing the index.php and htaccess files I ran into some issues.

For example:

My index.php currently looks like this:

switch($_SERVER['HTTP_HOST']) {
case 'domain2.com.au':
case 'www.domain2.com.au':
$mageRunCode = 'domain2';
$mageRunType = 'website';
break;
}
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = $mageRunCode;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = $mageRunType;
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);

The 2nd domain no longer redirects to the main website. However, it presents the following error in the Exception log:

[2021-04-27 03:18:13] main.CRITICAL: No such entity. {"exception":"[object] (Magento\Framework\Exception\NoSuchEntityException(code: 0): No such entity. at /var/www/html/cyclemotion.com.au/vendor/magento/module-store/Model/GroupRepository.php:70)"} []

I can't seem to find much online about this specific issue.

So I would really appreciate the help if anyone has experienced something similar. :)

Thanks.

1 Answer 1

0

please try to Magneto root second domains name folder link "domain2" in index.php file create and this code try to.Please check link

https://docs.google.com/document/d/1dUrezPuIW7upn_4CUZp46KxmPj6PUOFIEfWiiJo3oMQ/edit?usp=sharing

1
  • Unfortunately that didn't work for me. It returned a HTTP 500 error.
    – object10
    Commented Apr 27, 2021 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.