Problem with discourse in a subfolder

I followed this tutorial. but now, instead of example.com/forum/, my discourse is shown in forum.example.com/forum/
what could be wrong?

My advice

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

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'
3 Likes

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.

1 Like

Did my answer to your question work for you?

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

1 Like

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, and even worst, the control panel of the server is VestaCP :sweat_smile:.

2 Likes

I’ve followed the official discourse sub domain 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 ?

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

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 ?

Did you ./launcher rebuild app?

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

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

2 Likes

I’m following this guide to setup proxy through fastly.