# Multisite installation ... in subdirectories?

**URL:** https://meta.discourse.org/t/multisite-installation-in-subdirectories/151794
**Category:** Support
**Created:** [May 18, 2020, 7:15am UTC](https://meta.discourse.org/t/multisite-installation-in-subdirectories/151794 "2020-05-18T07:15:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jashankj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jashankj/32/179611_2.png) [@jashankj](https://meta.discourse.org/u/jashankj)
#### Post date: [May 18, 2020, 7:15am UTC](https://meta.discourse.org/t/multisite-installation-in-subdirectories/151794/1 "2020-05-18T07:15:50Z")

</div>

Hello!

I’m setting up Discourse in an environment where I need several distinct forums, and where the set of forums needs to be flexible to change over time. (Yes, I do need multiple forums; they serve distinct communities.)

The answer seems to be a multi-site installation, and I’ve made that work: I currently have a working configuration for multi-site, with split data and web containers, per [Multisite configuration with Docker](https://meta.discourse.org/t/multisite-configuration-with-docker/14084). (I have two hostnames, `$hostname.$domain` and `discourse.$domain`, which has worked in my testing so far.)

However, there’s a catch: I don’t have easy DNS control, so I cannot readily add multiple “real” hostnames. All the documentation I’ve thus far seen suggests I require this for multi-site, and a quick dig through the mechanism by which multi-site support is implemented suggests this is the case.

My ideal layout would be to have each forum sit within its own subdirectory; so `discourse.$domain/forum1`, …, `discourse.$domain/forumN`; and equally ideally, being able to serve those fora from the one web container, as existing multisite mechanisms do.

Empirically, I can successfully lift the “primary” forum into a subdirectory, moving it to `discourse.$domain/forum`, according to [Serve Discourse from a subfolder (path prefix) instead of a subdomain](https://meta.discourse.org/t/subfolder-support-with-docker/30507) — but this seems to tie the web container to exactly that subdirectory and, in my experiments, badly upsets multi-site.

I’ve also tried shenanigans like massaging the `Host:` header going into the web container, based on the path at the host’s frontend web server, to no avail — I get a weird blend of multiple forums.

So: is there a neat way to do this? Can I get away with only one web container, a la multisite? Or will I have to wear a second web container? Will that behave badly given those containers would both be pointed at the same data container with no knowledge of the other? Or am I completely up the tree?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [May 18, 2020, 3:07pm UTC](https://meta.discourse.org/t/multisite-installation-in-subdirectories/151794/2 "2020-05-18T15:07:53Z")

</div>

At the moment we don’t have support for multisite and subfolder at the same time. It is something we may pursue if a customer wants in the future, and that we estimate to be on the big side of efforts.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 18, 2020, 5:09pm UTC](https://meta.discourse.org/t/multisite-installation-in-subdirectories/151794/3 "2020-05-18T17:09:26Z")

</div>

If they’re all for the same base domain, my workaround would be to have `*.forum.example.com`. That way a single DNS entry would be all you needed.

---

<div class="post-metadata">

### Author: ![jashankj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jashankj/32/179611_2.png) [@jashankj](https://meta.discourse.org/u/jashankj)
#### Post date: [May 20, 2020, 7:47am UTC](https://meta.discourse.org/t/multisite-installation-in-subdirectories/151794/4 "2020-05-20T07:47:20Z")

</div>

Thanks, both! I don’t think I can stand up a star-subdomain now, unfortunately, so I think I’ll have to go with no multi-site and multiple web-frontend containers. (If I’d realised this before, I would have pushed to get a star-subdomain.)

I’d certainly love to see multi-site/subfolder support — in the (unlikely) event that I wind up with some time, I might have a look into it.
