Problem with discourse in a subfolder

(Hosein Naseri) #1

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

(Jay Pfaffman) #2

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'
2 Likes
(Hosein Naseri) #3

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
(Jay Pfaffman) #4

Did my answer to your question work for you?

(Hosein Naseri) #5

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

1 Like
(Hosein Naseri) #6

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
#7

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 ?

(Jay Pfaffman) #8

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

#9

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 ?

(Jay Pfaffman) #10

Did you ./launcher rebuild app?

#11

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

(Jay Pfaffman) #12

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

2 Likes
#13

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