PHPackages                             gerritvanaaken/multidomain-router - 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. gerritvanaaken/multidomain-router

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

gerritvanaaken/multidomain-router
=================================

A Kirby plugin for routing and managing multiple domains in a single Kirby installation.

1.0.3(2mo ago)972[2 issues](https://github.com/gerritvanaaken/multidomain-router/issues)MITPHPPHP &gt;=8.1

Since Nov 4Pushed 2mo agoCompare

[ Source](https://github.com/gerritvanaaken/multidomain-router)[ Packagist](https://packagist.org/packages/gerritvanaaken/multidomain-router)[ RSS](/packages/gerritvanaaken-multidomain-router/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (5)Used By (0)

Multidomain Router
==================

[](#multidomain-router)

A Kirby plugin for routing and managing multiple domains within a single Kirby installation.

How It Works
------------

[](#how-it-works)

The plugin automatically handles routing for multiple domains and replaces URLs in the rendered HTML output:

1. **Routing**: Intercepts all requests and maps them to the correct content folder based on the domain
2. **URL Replacement**: In the rendered output, all URLs are intelligently trimmed:
    - **links within current domain** (same folder): Converted to relative paths
    - **links to sibling domain** (different folder): Converted to the full absolute URLs

Installation (1/3)
------------------

[](#installation-13)

### via composer

[](#via-composer)

To install the Multidomain Router plugin via composer, run:

```
composer require gerritvanaaken/multidomain-router
```

Make sure you are in the root directory of your Kirby project when running this command.

After installation, the plugin will be available at `site/plugins/multidomain-router/`. You can then continue with the configuration as described below.

### manually

[](#manually)

Download and copy the full plugin folder into `site/plugins/`.

Domain Configuration (2/3)
--------------------------

[](#domain-configuration-23)

There are two methods to configure your domains:

### Method A: Config File (Recommended)

[](#method-a-config-file-recommended)

Add the domain configuration directly in your `site/config/config.php`:

```
