# 如何更改帖子中图片的旧版 CDN 网址？

**URL:** https://meta.discourse.org/t/how-do-i-change-the-legacy-cdn-urls-of-images-in-posts/97518
**Category:** Support
**Created:** [2018 年9 月 19 日 04:09 UTC](https://meta.discourse.org/t/how-do-i-change-the-legacy-cdn-urls-of-images-in-posts/97518 "2018-09-19T04:09:39Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### 作者： ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### 发布日期： [2018 年9 月 19 日 15:13 UTC](https://meta.discourse.org/t/how-do-i-change-the-legacy-cdn-urls-of-images-in-posts/97518/8 "2018-09-19T15:13:50Z")

</div>

Did you rebuild after you changed the value? ([Enable a CDN for your Discourse](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857), which is linked to in the `yml` file you edited says to rebuild after the change.)

> [@itsbhanusharma](#):
>
> If You only have to replace links in database, there is a rake find & replace task there just for this purpose.

No, what needs to be done is to do a rebake of the posts to fix the references to the old CDN. See [Disable CDN causes old images with CDN URL can not be shown - #2 by zogstrip](https://meta.discourse.org/t/disable-cdn-causes-old-images-with-cdn-url-can-not-be-shown/29657/2) for two ways to do it. The simpler way is:

```plaintext
# ssh into server
cd /var/discourse
./launcher enter app
rake posts:rebake

```

---

_[View the full topic](https://meta.discourse.org/t/how-do-i-change-the-legacy-cdn-urls-of-images-in-posts/97518)._
