# Nosso nome de domínio mudou, onde edito o hostname?

**URL:** https://meta.discourse.org/t/our-domain-name-changed-where-do-i-edit-the-hostname/104022
**Category:** Support
**Created:** [11 Dezembro , 2018 16:36 UTC](https://meta.discourse.org/t/our-domain-name-changed-where-do-i-edit-the-hostname/104022 "2018-12-11T16:36:57Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![mholt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mholt/32/120935_2.png) [@mholt](https://meta.discourse.org/u/mholt)
#### Post date: [11 Dezembro , 2018 16:36 UTC](https://meta.discourse.org/t/our-domain-name-changed-where-do-i-edit-the-hostname/104022/1 "2018-12-11T16:36:57Z")

</div>

Hi there – users are reporting that all links in emails are broken and they can’t login with any OAuth providers or reset passwords because Discourse is using a forum domain name that hasn’t been in use for about 2 years and doesn’t appear in the Discourse settings _anywhere_ (doing a search in the admin panel for all imaginable variants of the name and terms like “domain” or “host” or “address” or “URL” yield no relevant results).

The old domain appears to be a ghost in the shell. How can I force Discourse to use the actual name we’ve been using for about 2 years?

References:

- [Forum host name configuration - Site Feedback - Caddy Community](https://caddy.community/t/forum-host-name-configuration/4896)
- [caddy community password reset is broken · Issue #2386 · caddyserver/caddy · GitHub](https://github.com/mholt/caddy/issues/2386)

---

<div class="post-metadata">

### Author: ![mholt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mholt/32/120935_2.png) [@mholt](https://meta.discourse.org/u/mholt)
#### Post date: [11 Dezembro , 2018 16:53 UTC](https://meta.discourse.org/t/our-domain-name-changed-where-do-i-edit-the-hostname/104022/2 "2018-12-11T16:53:41Z")

</div>

Had to log in to the server and do a global `grep` for the hostname on the file system and found an instance in a file called `app.yml` in a folder `/var/discourse/containers`. Apparently the hostname of the forum is _hard-coded into the application_ instead of being configurable.

Edited the file, and it still didn’t work. Did some googling and ran `/var/discourse/launcher rebuild app` and after a few minutes of downtime it came back, and appears to be using the correct hostname now.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [12 Dezembro , 2018 01:30 UTC](https://meta.discourse.org/t/our-domain-name-changed-where-do-i-edit-the-hostname/104022/3 "2018-12-12T01:30:35Z")

</div>

Yes, the hostname is stored in `app.yml` and you need to rebuild to change that.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [13 Dezembro , 2018 03:38 UTC](https://meta.discourse.org/t/our-domain-name-changed-where-do-i-edit-the-hostname/104022/4 "2018-12-13T03:38:06Z")

</div>

For future reference, check out our #howto at [Change the domain name or rename your Discourse](https://meta.discourse.org/t/change-the-domain-name-or-rename-my-discourse/16098). After the rebuild you’ll still want to run the remap (see end of linked guide), or things (like internal links and possibly uploads depending on your configuration) will be broken.

---

<div class="post-metadata">

### Author: ![mholt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mholt/32/120935_2.png) [@mholt](https://meta.discourse.org/u/mholt)
#### Post date: [13 Dezembro , 2018 04:49 UTC](https://meta.discourse.org/t/our-domain-name-changed-where-do-i-edit-the-hostname/104022/5 "2018-12-13T04:49:23Z")

</div>

Incidentally, that does raise a question I’ve had through this process – why are links and uploads and other site-specific assets not hostname-relative? i.e. why spell out the full URL every time?

---

<div class="post-metadata">

### Author: ![mholt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mholt/32/120935_2.png) [@mholt](https://meta.discourse.org/u/mholt)
#### Post date: [13 Dezembro , 2018 04:52 UTC](https://meta.discourse.org/t/our-domain-name-changed-where-do-i-edit-the-hostname/104022/6 "2018-12-13T04:52:17Z")

</div>

Oh, so remapping posts is good to know (that guide you linked to didn’t appear in my googling) – but in trying it, I get this error:

```plaintext
Error: ERROR: duplicate key value violates unique constraint "index_incoming_domains_on_name_and_https_and_port"
DETAIL: Key (name, https, port)=(caddy.community, t, 443) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.

```

Doing what it says and re-running the script again shows the same error.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [13 Dezembro , 2018 16:32 UTC](https://meta.discourse.org/t/our-domain-name-changed-where-do-i-edit-the-hostname/104022/7 "2018-12-13T16:32:39Z")

</div>

To fix that error, try adding the scheme to the url. So if your remap command was  
`discourse remap talk.foo.com talk.bar.com`  
instead try  
`discourse remap https://talk.foo.com https://talk.bar.com`

> [@mholt](#):
>
> why are links and uploads and other site-specific assets not hostname-relative? i.e. why spell out the full URL every time?

Uploads no longer use the full URL, they’re something like `![116ae217fb1f57c4bd6058915c5db8abee9f0cd7|690x458](upload://2u570X7kQiPJQaJD1Bd8MLDHDNB.jpeg)`. Links do use the full domain as that’s how most people insert them into the composer, by pasting an absolute URL.

---

<div class="post-metadata">

### Author: ![mholt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mholt/32/120935_2.png) [@mholt](https://meta.discourse.org/u/mholt)
#### Post date: [13 Dezembro , 2018 21:38 UTC](https://meta.discourse.org/t/our-domain-name-changed-where-do-i-edit-the-hostname/104022/8 "2018-12-13T21:38:15Z")

</div>

Thanks, that did the trick.

---

<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: [12 Janeiro , 2019 21:48 UTC](https://meta.discourse.org/t/our-domain-name-changed-where-do-i-edit-the-hostname/104022/9 "2019-01-12T21:48:48Z")

</div>

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