# URLs mapped to root domain instead of cdn and wrong url path

**URL:** https://meta.discourse.org/t/urls-mapped-to-root-domain-instead-of-cdn-and-wrong-url-path/144412
**Category:** Support
**Created:** [March 15, 2020, 9:56pm UTC](https://meta.discourse.org/t/urls-mapped-to-root-domain-instead-of-cdn-and-wrong-url-path/144412 "2020-03-15T21:56:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Wolftallemo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wolftallemo/32/289645_2.png) [@Wolftallemo](https://meta.discourse.org/u/Wolftallemo)
#### Post date: [March 15, 2020, 9:56pm UTC](https://meta.discourse.org/t/urls-mapped-to-root-domain-instead-of-cdn-and-wrong-url-path/144412/1 "2020-03-15T21:56:17Z")

</div>

When I added a cdn to the instance I operate, after rebaking all of the posts instead of pointing to the cdn, it pointed to [domain.com/cdn.domain.com/original/2X/image.png](http://domain.com/cdn.domain.com/original/2X/image.png)

After trying to fix it the urls by remapping they pointed to [domain.com/uploads/uploads/default](http://domain.com/uploads/uploads/default)

So what I am trying to do is at the very least point it back to /uploads/default or possibly to the cdn again if it won’t be pain and suffering all the way.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 15, 2020, 10:22pm UTC](https://meta.discourse.org/t/urls-mapped-to-root-domain-instead-of-cdn-and-wrong-url-path/144412/2 "2020-03-15T22:22:05Z")

</div>

This sounds related / familiar to this issue [Multisite + short-url + secure\_uploads + s3](https://meta.discourse.org/t/short-url-secure-uploads-s3/144224)

> [@Wolftallemo](#):
>
> point it back to /uploads/default

`script/discourse remap //domain.com/uploads/uploads/ //domain.com/uploads/` should do the trick.

---

<div class="post-metadata">

### Author: ![Wolftallemo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wolftallemo/32/289645_2.png) [@Wolftallemo](https://meta.discourse.org/u/Wolftallemo)
#### Post date: [March 15, 2020, 10:25pm UTC](https://meta.discourse.org/t/urls-mapped-to-root-domain-instead-of-cdn-and-wrong-url-path/144412/3 "2020-03-15T22:25:39Z")

</div>

Would this work with pointing to the cdn as well or should I look for another method

---

<div class="post-metadata">

### Author: ![Wolftallemo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wolftallemo/32/289645_2.png) [@Wolftallemo](https://meta.discourse.org/u/Wolftallemo)
#### Post date: [March 16, 2020, 2:28pm UTC](https://meta.discourse.org/t/urls-mapped-to-root-domain-instead-of-cdn-and-wrong-url-path/144412/4 "2020-03-16T14:28:43Z")

</div>

So after some pain and suffering I found my solution.

- Upload missing files to s3 bucket with s3cmd
- Remap those to the cdn
- Remap more stuff to the cdn (which somehow were mapped to [https://uploads](https://uploads))  
And then redo this process for every different type of incorrect mapping

---

<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: [April 15, 2020, 2:28pm UTC](https://meta.discourse.org/t/urls-mapped-to-root-domain-instead-of-cdn-and-wrong-url-path/144412/5 "2020-04-15T14:28:56Z")

</div>

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