PHPackages                             b13/host-variants - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. b13/host-variants

ActiveTypo3-cms-extension[Utility &amp; Helpers](/categories/utility)

b13/host-variants
=================

Extends the base variants condition with current host.

1.4.0(1mo ago)35337.6k↓35.1%6[1 issues](https://github.com/b13/host_variants/issues)2GPL-2.0-or-laterPHP

Since Jun 25Pushed 1mo ago9 watchersCompare

[ Source](https://github.com/b13/host_variants)[ Packagist](https://packagist.org/packages/b13/host-variants)[ RSS](/packages/b13-host-variants/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (4)Dependencies (2)Versions (9)Used By (2)

EXT: host\_variants
===================

[](#ext-host_variants)

This extension allows to configure a base variant in TYPO3s Site Configuration depending on the current Host.

When is it useful?
------------------

[](#when-is-it-useful)

This extension can be useful when dealing with multiple sites in one TYPO3 instance with different domains:

Let's say you have a primary domain `primary-domain.tld` with a site configuration. Backend editors log in to this primary domain.

You have a site config with an own page tree for a second domain `another-domain.tld`. Editors create content for the second domain on a hidden page. When previewing that page from within the backend, `another-domain.tld/some-page-slug` will be shown. Since editors are logged in to the primary domain, the backend user cookie will not be sent by the browser for the secondary domain, the frontend does not see a logged in backend user and will show a 404.

The extension now allows configuring a site base variant for the secondary domain that kicks in when backend preview is called from the main domain, and calls the frontend of the secondary site as a sub path of the main domain instead.

Requirements
------------

[](#requirements)

- TYPO3 v11 LTS, v12 LTS or v13 LTS

Installation and Setup
----------------------

[](#installation-and-setup)

Install the extension via your preferred way. No further setup is required. The extension works out of the box.

What it does
------------

[](#what-it-does)

The extension adds a variable `host` to the expression language for the Site Configuration. This allows configuring multiple domains for the same root page.

Example
-------

[](#example)

Basic:

```
base: 'https://another-domain.tld/'
baseVariants:
  -
    base: 'https://primary-domain.tld/some-sub-path'
    condition: 'host == "primary-domain.tld"'
```

Using some ENV variable:

```
base: 'https://another-domain.tld/'
baseVariants:
  -
    base: 'https://%env(MAIN_DOMAIN)%/some-sub-path'
    condition: 'host == "%env(MAIN_DOMAIN)%"'
```

Combining conditions:

```
base: 'https://another-domain.tld/'
baseVariants:
  -
    base: 'https://local1.local/'
    condition: 'applicationContext == "Development" && host == "local1.local"'
  -
    base: 'https://local2.local/'
    condition: 'applicationContext == "Development" && host == "local2.local"'
```

---

*Made by [b13](https://b13.com) with ♥*

[Find more TYPO3 extensions we have developed](https://b13.com/useful-typo3-extensions-from-b13-to-you) that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance91

Actively maintained with recent releases

Popularity47

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 54.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~540 days

Total

5

Last Release

39d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/165630?v=4)[Benni Mack](/maintainers/bmack)[@bmack](https://github.com/bmack)

![](https://avatars.githubusercontent.com/u/7824856?v=4)[Daniel Goerz](/maintainers/ervaude)[@ervaude](https://github.com/ervaude)

---

Top Contributors

[![ervaude](https://avatars.githubusercontent.com/u/7824856?v=4)](https://github.com/ervaude "ervaude (12 commits)")[![bmack](https://avatars.githubusercontent.com/u/165630?v=4)](https://github.com/bmack "bmack (4 commits)")[![alexanderschnitzler](https://avatars.githubusercontent.com/u/711459?v=4)](https://github.com/alexanderschnitzler "alexanderschnitzler (2 commits)")[![davidsteeb](https://avatars.githubusercontent.com/u/3862523?v=4)](https://github.com/davidsteeb "davidsteeb (1 commits)")[![jschlier](https://avatars.githubusercontent.com/u/9108576?v=4)](https://github.com/jschlier "jschlier (1 commits)")[![lolli42](https://avatars.githubusercontent.com/u/2178068?v=4)](https://github.com/lolli42 "lolli42 (1 commits)")[![o-ba](https://avatars.githubusercontent.com/u/8812114?v=4)](https://github.com/o-ba "o-ba (1 commits)")

---

Tags

typo3-extension

### Embed Badge

![Health badge](/badges/b13-host-variants/health.svg)

```
[![Health](https://phpackages.com/badges/b13-host-variants/health.svg)](https://phpackages.com/packages/b13-host-variants)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

40529.5k](/packages/wazum-sluggi)[typo3/cms-scheduler

TYPO3 CMS Scheduler - Schedule tasks to run once or periodically at a specific time.

169.3M231](/packages/typo3-cms-scheduler)[typo3/cms-lowlevel

TYPO3 CMS Lowlevel - Technical analysis of the system. This includes raw database search, checking relations, counting pages and records etc.

178.2M317](/packages/typo3-cms-lowlevel)[typo3/cms-redirects

TYPO3 CMS Redirects - Create manual redirects, list existing redirects and automatically createredirects on slug changes.

167.4M80](/packages/typo3-cms-redirects)[typo3/cms-form

TYPO3 CMS Form - Flexible TYPO3 frontend form framework that comes with a backend editor interface.

147.6M266](/packages/typo3-cms-form)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
