We have been running a discourse forum (DOMAIN1) for 3 years. Now we want expand the discussion scope and add DOMAIN2. We succeeded getting them both active with letsencrypt thanks to this post. We will keep both domains active which worked after step 1 on this post. The second is redirected to the main domain name, which is good.
Part of the transition is to move all existing categories to a new top level category.
DOMAIN2 will become the main discourse domain, DOMAIN1 will remain linked so external links to posts still work.
Here is the question: How can we add a redirect if a “vanilla” DOMAIN1 is called (just the root URL, no path) to the new top level category URL? All other DOMAIN1 calls (with paths) should keep the existing path (no change, already works). Doing this will minimize confusion since everyone going to the DOMAIN1 will land in the category and everything will look similar as before.
Hope someone has a suggestions how add this conditional redirect with our double domain setup.
You’re going to have a hard time: A single Discourse instance cannot live at multiple URLs; and permalink redirection does not function for existing routes such as topic view.
So you’re saying there isn’t a simple way to do the following?
(1) go to domain1.com and it’s running discourse (with main hostname domain1.com - works)
(2) go to domain2.com and it goes to domain1.com/c/example/18 (what we also want)
(3) go to domain2.com/t/topic/1 and it shows either domain1.com/t/topic/1 or domain2.com/t/topic/1 (current works)
we are transitioning and want only the root of domain2.com to redirect to a category. is there any sort of URL rewriting that can do this?