Statamic Multisite Setup
Statamic Pro supports multiple sites from one installation with different domains, languages, and content sets. Content can be shared across all sites or unique to each.
Sites Configuration
// config/statamic/sites.php
return [
'sites' => [
'default' => [
'name' => 'My Site RU',
'locale' => 'ru_RU',
'url' => env('APP_URL', '/'),
'direction' => 'ltr',
'attributes' => ['lang' => 'ru'],
],
'english' => [
'name' => 'My Site EN',
'locale' => 'en_US',
'url' => env('SITE_EN_URL', 'https://mysite.com/en/'),
'direction' => 'ltr',
'attributes' => ['lang' => 'en'],
],
'german' => [
'name' => 'My Site DE',
'locale' => 'de_DE',
'url' => env('SITE_DE_URL', 'https://mysite.com/de/'),
],
],
];
Collections Localization
# content/collections/blog.yaml
sites:
- default
- english
- german
Localized entries are stored in folders by site handle:
content/collections/blog/
├── default/
│ └── my-post.md # Russian version
├── english/
│ └── my-post.md # English version
└── german/
└── my-post.md # German version
If a localized version is not created, Statamic shows fallback to the main site.
Globals with Localization
# content/globals/site.yaml (default)
title: My Site
phone: +7 999 123-45-67
footer_text: © 2024 My Site
# content/globals/site/english.yaml (override for en)
title: My Site
phone: +44 20 1234 5678
footer_text: © 2024 My Site
Language Switcher in Antlers
{{# List versions of current page #}}
{{ if entry }}
{{ collection:sites }}
{{ if sites_enabled }}
{{ foreach:localizations as="locale => localized_entry" }}
{{ if localized_entry }}
<a href="{{ localized_entry:url }}"
lang="{{ locale }}"
{{ if locale == {current_site:handle} }}aria-current="page"{{ /if }}>
{{ site:name }}
</a>
{{ /if }}
{{ /foreach:localizations }}
{{ /if }}
{{ /collection:sites }}
{{ /if }}
Simplified via helper:
{{ locales }}
<a href="{{ url }}" lang="{{ locale }}" {{ if is_current }}aria-current="page"{{ /if }}>
{{ name }}
</a>
{{ /locales }}
PHP Queries with Site Context
use Statamic\Facades\Entry;
use Statamic\Facades\Site;
// Entries of current site
$posts = Entry::query()
->where('collection', 'blog')
->where('site', Site::current()->handle())
->get();
// Entries of specific site
$enPosts = Entry::query()
->where('collection', 'blog')
->where('site', 'english')
->get();
SEO: hreflang Tags
{{# In <head> layout #}}
{{ if entry }}
{{ locales }}
<link rel="alternate"
hreflang="{{ locale }}"
href="{{ url }}">
{{ /locales }}
<link rel="alternate" hreflang="x-default" href="{{ entry:url }}">
{{ /if }}
Setting up multisite with 2–3 languages — 1–2 days.







