# Problem with discourse in a subfolder

**URL:** https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886
**Category:** Support
**Created:** [December 6, 2016, 8:40pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886 "2016-12-06T20:40:34Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![hnaseri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hnaseri/32/120660_2.png) [@hnaseri](https://meta.discourse.org/u/hnaseri)
#### Post date: [December 6, 2016, 8:40pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/1 "2016-12-06T20:40:34Z")

</div>

I followed [this tutorial](https://meta.discourse.org/t/subfolder-support-with-docker/30507). but now, instead of `example.com/forum/`, my discourse is shown in `forum.example.com/forum/`  
what could be wrong?

---

<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: [December 6, 2016, 8:50pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/2 "2016-12-06T20:50:59Z")

</div>

### My advice

Don’t waste your time with a complicated configuration that buys you nothing but headaches.

> [@codinghorror](#):
>
> On the bright side, pretty much everyone who has strong opinions on subdomains vs. subfolders doesn’t know what they’re talking about. They sure do have strong opinions anyway though!

But Mom always says that unsolicited advice is worth what you pay for it.

### The answer to your question

See the line in `app.yml` that looks like this:

```
  DISCOURSE_HOSTNAME: 'forum.example.com'

```

and change it to this:

```
  DISCOURSE_HOSTNAME: 'example.com'

```

---

<div class="post-metadata">

### Author: ![hnaseri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hnaseri/32/120660_2.png) [@hnaseri](https://meta.discourse.org/u/hnaseri)
#### Post date: [December 6, 2016, 8:58pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/3 "2016-12-06T20:58:49Z")

</div>

wow thank you very much for solving me the problem and also that SEO advice. However I believe that google is all about user experience. And yes theoretically sub-domains and sub-folders don’t have any difference in terms of seo. However from a user experience point of view, I believe that sub-folder is better.

---

<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: [December 6, 2016, 9:10pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/4 "2016-12-06T21:10:06Z")

</div>

Did my answer to your question work for you?

---

<div class="post-metadata">

### Author: ![hnaseri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hnaseri/32/120660_2.png) [@hnaseri](https://meta.discourse.org/u/hnaseri)
#### Post date: [December 6, 2016, 9:12pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/5 "2016-12-06T21:12:39Z")

</div>

I think the answer is logical but I’ve not tested it yet.

---

<div class="post-metadata">

### Author: ![hnaseri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hnaseri/32/120660_2.png) [@hnaseri](https://meta.discourse.org/u/hnaseri)
#### Post date: [December 6, 2016, 9:39pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/6 "2016-12-06T21:39:22Z")

</div>

I think I’m going to stick with your advice because things are much more complicated than what I was thinking! I use the same server to host my website and the forum, so I need to follow [this guide](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247/1), and even worst, the control panel of the server is [VestaCP](https://meta.discourse.org/t/discourse-vestacp/53443) 😅.

---

<div class="post-metadata">

### Author: ![sanjaynava](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sanjaynava](https://meta.discourse.org/u/sanjaynava)
#### Post date: [March 15, 2019, 9:53pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/7 "2019-03-15T21:53:01Z")

</div>

I’ve followed the official [discourse sub domain](https://meta.discourse.org/t/subfolder-support-with-docker/30507) guide for subfolder and I’m routing subfolder `www.example.com/forum` to discourse forum `forum.example.com` through fastly. I also changed the discourse hostname to `DISCOURSE_HOSTNAME: 'www.example.com'` now `www.example.com/forum` shows Error 503 Backend unavailable, is there anything need to change in DNS ?

---

<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: [March 15, 2019, 9:56pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/8 "2019-03-15T21:56:27Z")

</div>

That 503 suggests that your container isn’t running or is misconfigured.

---

<div class="post-metadata">

### Author: ![sanjaynava](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sanjaynava](https://meta.discourse.org/u/sanjaynava)
#### Post date: [March 15, 2019, 9:59pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/9 "2019-03-15T21:59:38Z")

</div>

If I change hostname back to `forum.example.com` it works fine but my forum show up on `forum.example.com/forum`. Is there anything need to change to show up forum on main domain sub folder `www.example.com/forum` ?

---

<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: [March 15, 2019, 10:02pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/10 "2019-03-15T22:02:24Z")

</div>

Did you `./launcher rebuild app`?

---

<div class="post-metadata">

### Author: ![sanjaynava](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sanjaynava](https://meta.discourse.org/u/sanjaynava)
#### Post date: [March 15, 2019, 10:04pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/11 "2019-03-15T22:04:09Z")

</div>

yes, I did `./launcher rebuild app` after hostname change. and rebuild was successful.

---

<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: [March 15, 2019, 10:25pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/12 "2019-03-15T22:25:18Z")

</div>

Then whatever you configured to reverse proxy isn’t configured correctly.

---

<div class="post-metadata">

### Author: ![sanjaynava](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sanjaynava](https://meta.discourse.org/u/sanjaynava)
#### Post date: [March 16, 2019, 12:32am UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/13 "2019-03-16T00:32:23Z")

</div>

I’m following [this guide](https://meta.discourse.org/t/discourse-in-a-subfolder-multiple-servers-sharing-a-domain/30514) to setup proxy through fastly.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [May 4, 2022, 5:53pm UTC](https://meta.discourse.org/t/problem-with-discourse-in-a-subfolder/53886/15 "2022-05-04T17:53:53Z")

</div>


