1
votes

Does anybody have sophisticated knowledge about running a multi-domain-site using a single typo3-instance ? E.g. I have 2 domains, both being served by the same webserver, using different vhosts. What I want to achieve, is both vhosts pointing to the same document root, where a typo3-instance is installed. This TYPO3-instance should check by typoscript, which domain was used in the request and forward requests for each domain to a specific subpage ("landing page for that domain"). I need this to work in a productional & stable environment, due to custom-self-developed extensions, which provide necessary data for both installations, also specific extbase-domain-models should be usable in both domains etc.

I am already able to check the requested domain via typoscript-conditions. What I am missing, is some info, about how I could possibly realize the redirection, without the client being redirected to the landing page each time while using sub-pages of the landing-page. Do I need to set cookies for this !?

Thanks in advance, Oliver

1
Do you really need to check via TypoScript? Can you use domain records? This can actually be solved quite simple using domain records, unless I am missing something here.Sybille Peters
Well TypoScript was just my first idea, since I didn`t hear about domain records at all, yet :D !? Edit says : thanks a bunch, looking up typo3 domain records via google helped me find a nice and decent HowTo.Oliver

1 Answers

2
votes

In TYPO3, you can combine several sites (each with a different domain) in one Installation. This already works out of the box.

So, for this requirement

This TYPO3-instance should check by typoscript, which domain was used in the request and forward requests for each domain to a specific subpage

it is not necessary to add a check for TypoScript, TYPO3 will automatically resolve the URLs.

Page Tree:

pid=0
 | --> root page 1
 | --> root page 2
  • On both root pages, enter page properties : "Behaviour" checkmark enable "Use as Root page"
  • On both root pages, create a TypoScript template, edit it, got to tab "Options", checkmark "Rootlevel". Have this TypoScript template include your general TypoScript configuration, e.g. via "static includes" (ideally you put your TypoScript configuration in an extension)
  • Since TYPO3 9: configure a site for each page tree under "Site Management > Sites". Before TYPO3 9: On both root pages create a "Domain" record