Hi guys are the any more detailed tutorials on how to setup a multi site on Craft3 BETA? I created two sites now, a Danish and English through the admin (Settings → Sites). The domain is the same but the Danish version will have the path http://localhost:8888/dk
whereas the English version will be everything that does not have the first path of /dk
.
I have set in the general.php
the following:
return [
'*' => [
'omitScriptNameInUrls' => true,
'usePathInfo' => true,
'generateTransformsBeforePageLoad' => true
],
'SITEHANDLE_NAME_ENGLISH' => [
'siteUrl' => 'http://localhost:8888/
],
'SITEHANDLE_NAME_DANISH’ => [
'siteUrl' => 'http://localhost:8888/dk'
],
'defaultWeekStartDay' => 1,
'enableCsrfProtection' => true,
'omitScriptNameInUrls' => 'auto',
'cpTrigger' => 'admin',
'devMode' => false,
];
In the Danish folder /dk
, I created a new index.php
, and the site correctly direct to this file from the URL, BUT, it does not change the site to the the Danish site, even though I have defined my index.php
with the new php constant:
<?php
// Project root path
$root = dirname('../');
define('CRAFT_SITE', "SITEHANDLE_NAME_DANISH");
// Composer autoloader
require_once '../craft_folder/vendor/autoload.php';
// dotenv?
if (file_exists("../craft_folder/.env")) {
$dotenv = new Dotenv\Dotenv("../craft_folder/");
$dotenv->load();
}
// Craft
define('CRAFT_BASE_PATH', "../craft_folder/");
$app = require '../craft_folder/vendor/craftcms/cms/bootstrap/web.php';
$app->run();
How do I tell Craft to load the Danish site from the index.php
? Right now it will only load the primary site not matter what I try.
Thanks!