Jump to main address automatically?

AI-generated summary

xiasummer is trying to switch their Discourse instance from domain name1 to name2, but wants users accessing name1 to be automatically redirected to name2. They observed that when both domains point to the same IP via GoDaddy DNS, the redirect works—but when name2 is behind Cloudflare (hiding its IP), the redirect fails. Interestingly, if name1 is the main address and not behind Cloudflare, accessing name2 redirects to name1. xiasummer seeks a way to preserve automatic redirection from name1 to name2 even with Cloudflare in use. pfaffman advises against using Cloudflare for this setup, warning it causes issues, and recommends following the official guide Change the domain name or rename my Discourse? or performing a fresh installation with database restore instead.

I have a server with a discourse instance.

It has a domain name1.
While I want to change it to name2.

I found that:

  1. If both “name1” and “name2” are simply set by godaddy DNS address, with the same ip address, if you still type “name1”, it will automaticly jump to “name2”.

  2. But, if I set domain by cloudflare while the name2 ip address was hided by cloudflare. In this case, “name1” will not jump to “name2” anymore.

    • While I found it interesting that if I use “name1” as main address, then typing “name2” will automatically jump to “name1”. Because name1 is not hided by cloudflare.
      Still, I really want to use the new name2 inplace of name1, but I cannot notify all users to use name2, I hope the instance will jump to name2 automatically.

While can we make some modification, that we can still have the first feature? Typing “name1” still automatically jump to “name2”?

That’s what you want. You don’t want the data on both domains.

Don’t do that. No good can come from it.

See Change the domain name or rename my Discourse?, but what I usually do is instead do a new installation and restore the database there.