# Twitter Card image meta uses relative URL

**URL:** https://meta.discourse.org/t/twitter-card-image-meta-uses-relative-url/50052
**Category:** Bug
**Created:** [September 13, 2016, 12:43am UTC](https://meta.discourse.org/t/twitter-card-image-meta-uses-relative-url/50052 "2016-09-13T00:43:24Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![DanielMarquard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danielmarquard/32/74010_2.png) [@DanielMarquard](https://meta.discourse.org/u/DanielMarquard)
#### Post date: [September 13, 2016, 12:43am UTC](https://meta.discourse.org/t/twitter-card-image-meta-uses-relative-url/50052/1 "2016-09-13T00:43:24Z")

</div>

Since I began using Discourse, the Twitter Card image meta URL has always used relative URLs for topics with uploaded images. I think Facebook can handle relative image URLs, but Twitter does not seem to like them, so no image is displayed in tweets.

I’ve been working around this by using absolute URLs for images in posts, which worked up until last week. Now, even if the post uses the absolute URL, the image’s relative URL is still used in the Twitter Card image meta tag. Like in [this topic](https://critcola.com/community/t/crit-cola-needs-strat-callers/147), for example.

I’ve tried setting `DISCOURSE_CDN_URL`, which didn’t seem to affect this tag. `DISCOURSE_RELATIVE_URL_ROOT` is set because we’re running in a subdir. If I remember correctly, when I tried changing this is to be an absolute URL, it broke the URL structure for many links.

Any idea how to address this?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [September 13, 2016, 5:04am UTC](https://meta.discourse.org/t/twitter-card-image-meta-uses-relative-url/50052/2 "2016-09-13T05:04:12Z")

</div>

> [@DanielMarquard](#):
>
> Any idea how to address this?

By posting here as a #Contribute > Bug, and we make a code change to add `UrlHelper.absolute` to that code 😉

---

<div class="post-metadata">

### Author: ![DanielMarquard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danielmarquard/32/74010_2.png) [@DanielMarquard](https://meta.discourse.org/u/DanielMarquard)
#### Post date: [October 1, 2016, 6:09pm UTC](https://meta.discourse.org/t/twitter-card-image-meta-uses-relative-url/50052/3 "2016-10-01T18:09:18Z")

</div>

Any update on this? We still have this bug on our website. 🙂

---

<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: [October 1, 2016, 9:32pm UTC](https://meta.discourse.org/t/twitter-card-image-meta-uses-relative-url/50052/4 "2016-10-01T21:32:55Z")

</div>

Do we have this issue on our hosted subfolder installs @neil?

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [October 5, 2016, 7:17pm UTC](https://meta.discourse.org/t/twitter-card-image-meta-uses-relative-url/50052/5 "2016-10-05T19:17:36Z")

</div>

I pushed a fix for this. Subfolder bugs begone! 🚫 🐜 🚫

---

<div class="post-metadata">

### Author: ![DanielMarquard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danielmarquard/32/74010_2.png) [@DanielMarquard](https://meta.discourse.org/u/DanielMarquard)
#### Post date: [October 5, 2016, 7:30pm UTC](https://meta.discourse.org/t/twitter-card-image-meta-uses-relative-url/50052/6 "2016-10-05T19:30:44Z")

</div>

> [@neil](#):
>
> I pushed a fix for this. Subfolder bugs begone! 🚫 🐜 🚫

🙌 You’re the best! We’ve really needed this! 🙂

---

<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: [October 21, 2016, 5:21am UTC](https://meta.discourse.org/t/twitter-card-image-meta-uses-relative-url/50052/7 "2016-10-21T05:21:24Z")

</div>


