0

I am trying to setup a Magento Cloud 2.2.2 site that has a multi store setup running.

I am using Vagrant, with PHP 7.1 and Nginx.

Nginx is using the stock M2 Ngxin conf, with added SSL support.

There are a few stores, but for now I'm just concentrating on the default and UK stores.

I made a new folder in /pub with the Site code, /pub/uk and dropped in an index.php

try {
    require __DIR__ . '/../../app/bootstrap.php';
} catch (\Exception $e) {
    echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
    <div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
        <h3 style="margin:0;font-size:1.7em;font-weight:normal;text-transform:none;text-align:left;color:#2f2f2f;">
        Autoload error</h3>
    </div>
    <p>{$e->getMessage()}</p>
</div>
HTML;
    exit(1);
}

$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'uk';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
$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);

Add Store Code to URLs is set to Off.

I can access http://magento.test, and http://magento.test/uk but when I try to access a category on the UK site, I get a 404 page.

Added to this, despite being in developer mode, the assets are not generating automatically. I did an initial static deploy and that made the default site work, but when going to /uk its look in the path /uk/pub/static which doesn't exist.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.