Showing different settings according to different domain

AI-generated summary

Showing different settings according to different domain

The discussion revolves around using a single Discourse instance for multiple online products, each with its own domain. kratos wants to display a different theme for each community based on the domain used to access it and hide threads with tags from other products.

kratos acknowledges that this functionality might not be available out of the box and is willing to create a plugin to achieve this. The first step is to allow the Discourse instance to run on multiple domains.

pfaffman advises against duplicating content across multiple sites, citing SEO concerns. However, they suggest an alternative approach using a theme component that changes the home page based on user group, which can be set according to a custom field. Additionally, pfaffman shares a link to a guide on setting up multisite configuration with Let’s Encrypt and no reverse proxy.

Hey there,

I have several online products, each of which I’d like to have its own online community. However, because these products are interoperable, many of my customers use multiple products simultaneously.

With that in mind, I want to use a single Discourse instance for all my products but display a different theme for the community based on the domain used to access it.

For example:

  • app1 → shows App1’s logo and colors
  • app2 → shows App2’s logo and colors

Additionally, since all threads are required to be tagged based on the product name, I’d like to hide threads with tags from other products. For instance, hide #app1 if you’re accessing app2.com.

This should occur unless the user opts to browse multiple communities at once.

I could use any help; however, I understand something like this might not be available out of the box. As a developer, I can create a plugin and write additional JavaScript code to make this happen.

I suppose the first obstacle is allowing the same Discourse instance to run on multiple domains. How do I get started with this?

Having the same information on multiple sites is an SEO and no-no. I don’t recommend it. I have a (I think broken, but I’ll fix it Real Soon Now) theme component that will change the home page depending on what group someone is in so you could set their group according to a custom field you get when they create their account to set their hole page to the category for their favorite product.

If your don’t care about having your site indexed, you can look at the web_only template that redirects and add to your yml to un-do that. I think that Setup Multisite Configuration with Let’s Encrypt and no Reverse Proxy offers an example.