# New domain new server and 301 redirect

**URL:** https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250
**Category:** Self-hosting
**Created:** [September 7, 2020, 12:50pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250 "2020-09-07T12:50:34Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![ayberk](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@ayberk](https://meta.discourse.org/u/ayberk)
#### Post date: [September 7, 2020, 12:50pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/1 "2020-09-07T12:50:34Z")

</div>

Hello,

We transferred the forum to the new server and new domain. But I have to redirect URLs with 301. I did research on the forum but could not find clear information.

Thank you.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 7, 2020, 2:43pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/2 "2020-09-07T14:43:52Z")

</div>

If both domains are pointing to the current server, then everything should work for http links, but will not work for https links because the certificate won’t match. You can have a look at [Setting up Let’s Encrypt with Multiple Domains](https://meta.discourse.org/t/setting-up-let-s-encrypt-with-multiple-domains/56685).

---

<div class="post-metadata">

### Author: ![ayberk](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@ayberk](https://meta.discourse.org/u/ayberk)
#### Post date: [September 7, 2020, 3:14pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/3 "2020-09-07T15:14:00Z")

</div>

The old site is on another server, the new site is on a new server. SSL certificates of both are different. Any other suggestions?

There are hundreds of messages on the old site and we cannot redirect them.

---

<div class="post-metadata">

### Author: ![marianord](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marianord/32/90502_2.png) [@marianord](https://meta.discourse.org/u/marianord)
#### Post date: [September 7, 2020, 3:29pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/4 "2020-09-07T15:29:01Z")

</div>

Are both Discourse installations? Discourse handles the change of the domain and you can just setup the old domain to redirect to the new domain, this can be done in a temporary server or via DNS (not recommended).

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 7, 2020, 3:32pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/5 "2020-09-07T15:32:09Z")

</div>

If the old server is still running, then you need to configure it to redirect to the new server.

The old server is a Discourse server? You changed the domain name? Why is the old server still running? Maybe just have the old server 301 to the new domain?

---

<div class="post-metadata">

### Author: ![ayberk](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@ayberk](https://meta.discourse.org/u/ayberk)
#### Post date: [September 7, 2020, 3:39pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/6 "2020-09-07T15:39:07Z")

</div>

Yes they are both Discourse. To be more specific; We are talking about 2 different Digitalocean installations. What would be your recommendation?

So is it actually possible to redirect in itself without the need for a new server?

---

<div class="post-metadata">

### Author: ![ayberk](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@ayberk](https://meta.discourse.org/u/ayberk)
#### Post date: [September 7, 2020, 3:41pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/7 "2020-09-07T15:41:25Z")

</div>

Yes, the old server is still active. My goal was to redirect from there to the new server and domain, with 301. So you are recommending 301 too. So how can I direct it?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 7, 2020, 3:54pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/8 "2020-09-07T15:54:03Z")

</div>

> [@ayberk](#):
>
> Yes, the old server is still active.

Why? Is it running something other than Discourse?

If you have something else running on the server that you need to keep running, then you’d google something like “301 redirect domain NGINX” (or Apache, if that’s what you’re usijng).

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [September 7, 2020, 3:57pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/9 "2020-09-07T15:57:58Z")

</div>

If you’re just redirecting all traffic to the root of the new site you can use a free Cloudflare account and a page rule to catch http and https.

---

<div class="post-metadata">

### Author: ![ayberk](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@ayberk](https://meta.discourse.org/u/ayberk)
#### Post date: [September 7, 2020, 4:04pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/10 "2020-09-07T16:04:18Z")

</div>

Actually no, only Discourse works. Since I was looking at the thing from a classic perspective, I thought I would still need the old server for 301. What exactly is the method you propose?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 7, 2020, 4:25pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/11 "2020-09-07T16:25:10Z")

</div>

I recommend what I said in the second post.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [October 7, 2020, 4:28pm UTC](https://meta.discourse.org/t/new-domain-new-server-and-301-redirect/163250/12 "2020-10-07T16:28:48Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
