How can we add an addon sub-domain in Discourse


(Gulshan Kumar) #1

Hello,

I am experimenting with something.

This is just an example, to explain in simple way.

Suppose that discourse is hosted at https://meta.example.org

I want an additional subdomain https://docs.example.org for accessing same website, without altering source code. Just, address bar URL should change, and nothing else. Nor, I need redirect. Just I need clone.

What problem I am facing?

When I add simply CNAME docs it redirects to meta. I don’t want that.

can we make this possible? If yes, please let me know how.

Thanks & Regards,
Gulshan


(Felix Freiberger) #2

This isn’t supported by Discourse, it expects to be running under exactly one domain.

Also, if you did that, search engines would heavily penalize you for duplicate content.


(Christoph) #3

I have also been thinking that it would be nice to be able to map categories onto subdomains (i.e. instead of redirecting to the category homepage, the category url becomes category.myforum.com) so that each category could me treated more like a (sub-)forum of its own. But that is not possible and I assume it won’t be possible any time soon, as it requires substantial changes with lots of potential problems only for a rather minor cosmetic change.

But maybe this can be done with a reverse proxy rewriting urls? Probably a lot of rewriting, though.


(Gulshan Kumar) #5

Search Engine will not create problem because rel='canonical' would be same as before. That will prevent from duplicate content penalty. If needed, later I may think about doing redirection 301 Based on search engine bots condition.


(Matt Palmer) #6

You’ll probably have a very hard time making a reverse proxy setup work, because of the need to rewrite all the page content (including, in many cases, JSON responses, not just HTML) to mangle the URLs. The best I think you could do in the short term would be to have https://category.example.com redirect to, say, https://forum.example.com/c/category, which doesn’t solve the “cosmetic” problem, but does at least make it easier to provide vaguely-memorable URLs for people to enter (for, say, advertising purposes).