# More granular multi-site folder setup

**URL:** <https://forum.getkirby.com/t/more-granular-multi-site-folder-setup/1361>\
**Category:** Questions\
**Tags:** v2\
**Created:** [June 16, 2015, 1:35pm UTC](https://forum.getkirby.com/t/more-granular-multi-site-folder-setup/1361 "2015-06-16T13:35:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![plaidpowered](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/plaidpowered/32/271_2.png) [@plaidpowered](https://forum.getkirby.com/u/plaidpowered)\
**Post date:** [June 16, 2015, 1:35pm UTC](https://forum.getkirby.com/t/more-granular-multi-site-folder-setup/1361/1 "2015-06-16T13:35:14Z")

</div>

I have a 4-URL project I’m setting up. Content for each site is in its own folder, but I’m using the same accounts, blueprints, and templates across all four sites (so they are using the same “site” folder).

I was wondering if it’s possible to get even more granular with the folder routing. For instance, I’d like to separate the templates for each of these sites (something like `site/templates/website-a/`), but still keep common blueprints and accounts.

Even better, if there was a way to have “default” fallback templates across the whole multisite, but have site-level template files override the default. This, I’m sure, will take some coding, but I don’t know enough about the Kirby internals to know where to start.

---

<div class="post-metadata">

**Author:** ![plaidpowered](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/plaidpowered/32/271_2.png) [@plaidpowered](https://forum.getkirby.com/u/plaidpowered)\
**Post date:** [June 16, 2015, 1:42pm UTC](https://forum.getkirby.com/t/more-granular-multi-site-folder-setup/1361/2 "2015-06-16T13:42:46Z")

</div>

A stopgap solution I came up with is to drop this at the top of my templates:

```php
// if site/templates/{site}/{template-file} exists, use instead
if (file_exists( __DIR__. DS . kirby()->urls()->site . DS . "home.php")) {
  include __DIR__. DS . kirby()->urls()->site . DS . "home.php";
  exit;
}

```

It’s not super elegant, and it means the code has to be on _each_ of my default templates. Hoping somebody’s got a better idea.

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [June 16, 2015, 7:47pm UTC](https://forum.getkirby.com/t/more-granular-multi-site-folder-setup/1361/3 "2015-06-16T19:47:40Z")

</div>

Right now you can’t change the template, snippet etc. directories separately by overriding the paths from your `site.php` file. I opened a [PR](https://github.com/getkirby/kirby/pull/252) a few days ago that lets you do that. But there’s no `default.php` fallback functionality in there though.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:17pm UTC](https://forum.getkirby.com/t/more-granular-multi-site-folder-setup/1361/4 "2025-02-06T17:17:14Z")

</div>


