1

I have 2 sites within 1 Craft 3 installation, they are both the same language and generally have nothing to to with each other.

I would like both to have individual startpages at the URL "/".

  • Is this possible?
  • With 1 or 2 sections (structures in my case)?

Thanks, Matthias

  • What do you mean by having individual start pages at "/", do you mean on two different domains? – user3788089 Sep 18 '19 at 10:20
  • yes, that's what I mean: 2 different domains showing 2 different sites being served from one Craft instance and both domains should have a startpage at / – Matthias Redl-Mann Sep 18 '19 at 10:50
1
  1. Create a new site in Settings > Sites > New Site
  2. Make sure "This Site Has Its Own Base URL" is checked
  3. Go to the "Entries" section, publish a page, and set the entry slug as __home__
  4. Return to the Entries section, switch to Site 2 using the dropdown menu at the top of the screen
  5. Publish a page and set the entry slug as __home__

Craft knows which site each page belongs to, so there will be no conflict between the slugs.

You can use any section you like to publish your homepages, as long as the Entry URI Format in the section's settings doesn't require a special syntax. Many people use a "Single"-type section or a "Structure"-type section with a URL setting of {parent.uri}/{slug}. Make sure the section is available to be used by Site 2 in the section settings.

|improve this answer|||||
  • Thanks kmgdev. I always thought about different sections for each site and how I would enable them for one of the sites only. But the trick is to keep them in the same site.... Thanks! – Matthias Redl-Mann Sep 19 '19 at 20:19
  • Additional info: It also works if you have 2 different sections which contain the startpages for the different sites. Craft is smart enough :-) – Matthias Redl-Mann Oct 7 '19 at 8:06

Your Answer

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

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