I'm trying to set up a multisite with Craft 3, and the client wants a set up with URLs that look like foo.client.com, with foo.client.com/2018 and foo.client.com/2019. Right now, my index.php file looks like this:

switch(explode('/', $_SERVER['REQUEST_URI'])[1]) {
  case '2018':
    define('CRAFT_SITE', 'twentyEighteen');
    define('CRAFT_SITE', 'default');

This correctly changes the site if I go to /2018, but the problem is that Craft is looking for templates at templates/2018/xx/xx instead of templates/xx/xx.. So when I go to foo.client.com/2018 I get:

Template not found: 2018

In the back-end I have the twentyEighteen site defined and the site base URL is set to http://foo.client.com/2018/.

I know that this should work because they even use /en and /nl as examples in the Craft 2 Localization Guide, and Craft 3 multisites work similarly.

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.