Install to subfolder instead of subdomain (SEO optimization)

(Darren) #4

The SEO pros over at SEOMOZ are pretty clear that subdomains do not transfer as much link juice back to the root site as folders.

Furthermore, some internal experiments we’ve run with subdomains vs subfolders have shown that google does not treat the subdomain as being part of the root site.

For example:


(Jeff Atwood) #5

Interesting; were these experiments recent? The cited article is from four years ago. Google has changed how they rank things a lot in the last 4 years.

However, it does make sense that:

are really different sites with their own content, though clearly related, versus say:

Which are more tightly related.

In general, I am not sure you want the discussion area of your site, with 100% user generated content, to be so tightly coupled to your main site if it is highly curated editorial articles.

Discourse does support running in a subfolder, but it is by its very nature a far more complex hosting setup and not to be embarked upon lightly.


(Jeff Atwood) #10

Here’s actual text I got from an email to Matt Cutts today

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!

I kind of agree we need to support running in a subfolder for reasons of flexibility, but I am bitter about it since someone who would know better than anyone else in the world says it’s not necessary for Google ranking reasons alone…


Launch Discourse on In a web folder type
Problem with discourse in a subfolder
(Darren) #11

Well that’s about as conclusive as it gets, I guess. :slight_smile:

1 Like

(TheLoneCuber) #12

Hardly @darrennix: that’s one selective sentence “on the bright side of things”. What about the rest of the email @codinghorror? Can you elaborate more? What was the dark side of the subdomain discussion?


(Jeff Atwood) #13

Anyway, this is supported now, running Discourse in a subfolder is supported, but it is a giant PITA (and expensive, as you have to use a forward proxy to redirect the subfolder traffic) if you are being hosted.

If you are hosting Discourse yourself along with all your other websites, it is less challenging.

1 Like

(TheLoneCuber) #14

I’d love to run off sub-dirs instead of a sub-doms @codinghorror but I’ll settle for the less PITA solution. I’m still interested to know some more details on the Matt Cutts sub-dir email…



@codinghorror can you share more details about why it’s expensive? It’s expensive in terms of processing because you need another webserver in front to redirect traffic?

1 Like

(Jeff Atwood) #16

It is vastly more complex since you need to route all subfolder traffic to a different server on the Internet. That is kind of unusual. And it requires a forward proxy in front of the website, a rather sophisticated one, with a lot of configuration applied. It is not a simple operation.

(It is somewhat simpler if everything happens to be on the same physical server)



What if, we host discourse at and then a blog at /b/?

This would be much simpler discourse will be untouched, and a reverse proxy in front of a blog should be easy. Also, all the content will be at the same domain. Just and idea.


(Michael - #18

That has always been possible from a technical point of view.
But most people that combine a blog with Discourse, want the blog to show up at the front page.



@codinghorror mentioned Fastly as a forward proxy to send subfolder requests over to your Discourse site, presumably sitting on a beefier server. Fastly is a minimum $50 a month.


(Guillaume Paumier) #20

I’m looking into Discourse and I really like it. My use case for using a subfolder would be to avoid buying an SSL certificate for another subdomain; if I could set up Discourse in a subfolder, I could re-use my site’s existing certificate.

However, reading this thread, I’m starting to see the other advantages of a subdomain install. Also, initiatives like might soon make this argument irrelevant.


(Geneus) #21

Thanks for the clarification @codinghorror. Can steps to install in a subdirectory be added to the installation guide? Or possibly a separate guide as I would imagine the installation process differs quite substantially to the established one?


1 Like

(Daniel Marquard) #22

I hate to reignite an old thread, but this is one of the top results on Google, and I wanted to throw in my two cents on the matter. It seems like the defense of using subdomains over subdirectories has centered around SEO, but I think a case can be made for subdirectories regardless of SEO.

First, a lack of support for subdirectories seems like a deviation from a longstanding convention. Discourse’s subdomain approach is inconsistent with nearly all other discussion software I’ve worked with in the past.

A big thing for me is branding. At my company, I have our website using no subdomains at all, not even for our CDN, and especially not WWW. All resources branch from the naked domain, something I’d consider to be a best practice, or at least a goal to strive for, for customer-facing websites.

Encryption is another issue, and this does actually speak to SEO. With Discourse installing to a subdomain, most websites would end up needing two certificates or one wildcard certificate; both of which would not be necessary if Discourse installed to a subdirectory.

I’m looking into using Nginx or Varnish to rewrite the URLs in this manner. Not sure where I’ll get with that, but I’m optimistic. Any plans to support subdirectories in the future?


(Rafael dos Santos Silva) #23

Let’s Encrypt made SSL Certs free, so no problem here.

Discourse already supports subfolder.


(Jeff Atwood) #24

We do support subfolder, but the massive increase in hosting complexity (forward proxy, long polling breaks, etc) required for subfolder is rarely if ever warranted by the negligible SEO snake oil benefit.

It is a huge, huge jump in complexity for basically no reason other than “SEO magicks”. If it wasn’t so complex, I wouldn’t care – but it is. And more complex means more error prone, harder to support, harder to troubleshoot, and more costly. We only even offer subfolder hosting on our Enterprise plan and even then it is a paid add-on above and beyond the normal Enterprise hosting rate.



Is this still relevant in 2018? Topics like this should always be kept updated because google will keep bringing people here.

1 Like

(David Taylor) #26

Documentation about subfolder support can be found here:

And our official position on this:


(Jay Pfaffman) #27

I don’t have or offer an opinion on SEO. I have done sub folder installs and maintenance for a couple clients. It’s not been trouble free, but they’ve been happy. If you need help with installation my contact info is in my profile.