Skip to content

Instantly share code, notes, and snippets.

@pniederlag
Last active November 19, 2020 19:03
Show Gist options
  • Save pniederlag/09edfb18e7a1c8ec8620c3098d9f98cc to your computer and use it in GitHub Desktop.
Save pniederlag/09edfb18e7a1c8ec8620c3098d9f98cc to your computer and use it in GitHub Desktop.
TYPO3 multi-domain/site-config with selection by TYPO3_CONTEXT
# example typo3 site-config for multi-site project with different instances/hosts by TYPO3_CONTEXT
# (not verified/tested yet)
rootPageId: 100
base: 'https://first-project.example.com/'
baseVariants:
-
base: 'https://xx.example.local/'
condition: 'applicationContext == "Development/Server1"'
rootPageId: 200
base: 'https://second-project.example.com/'
baseVariants:
-
base: 'https://yy.example.local/'
condition: 'applicationContext == "Development/Server1"'
# Can I re-use the very same applicationContext here ^^ ?
# Bonus: Does this work with solr indexing config?
@julianhofmann
Copy link

Yes, you can use the context in both site configurations (=different domain/rootpages)

Bonus:
No, you don't have conditions for solr properties.
Since EXT:solr v10 you can use environment variables in the siteConfiguration to configure different solr instances. See "How can I use different host / port configurations in Solr v10 (e.g. for local environments)?" in the FAQ (it's the last question)

@pniederlag
Copy link
Author

pniederlag commented Nov 19, 2020

Thx! :-> I was not even really refering to using different solr properties, I thought about connecting the site-root to the proper domain for the solr-indexing from the scheduler job. I think this is indeeed already solved by using the proper TYPO3_CONTEXT.

each solr-indexer scheduler task has configured a site-root... the site-root changes based on TYPO3_CONTEXT... that's quite fine and would be sufficient for me to be happy... I think it would work out that way.

For changing properties I could easily stick with conditions (as in the good ol' days) or flip to .env ... sounds great! :->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment