# Images not loading - Possible HTTPS issue

**URL:** <https://meta.discourse.org/t/images-not-loading-possible-https-issue/149398>\
**Category:** Support\
**Created:** [April 27, 2020, 1:48am UTC](https://meta.discourse.org/t/images-not-loading-possible-https-issue/149398 "2020-04-27T01:48:16Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![spectrum](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spectrum/32/142226_2.png) [@spectrum](https://meta.discourse.org/u/spectrum)\
**Post date:** [April 27, 2020, 1:48am UTC](https://meta.discourse.org/t/images-not-loading-possible-https-issue/149398/1 "2020-04-27T01:48:16Z")

</div>

Hi there,  
We’re experiencing an issue where relative-linked images, embedded in the fashion of `<img src="/link/to/image.jpg" />` from Drupal, are not loading once they are posted as topics within Discourse. I think this is because they are being linked using HTTP from our **discourseEmbedUrl** variable; but our server delivers all content over HTTPS, which results in a broken image. This is fixed when the link is modified within Developer Tools, for example, to change the link from HTTP to HTTPS.

Tl;dr version: **Is it possible to have Discourse use the _discourseUrl_ variable for embedding images, instead of _discourseEmbedUrl_?**  
Longer explanation below describes how we arrived at this configuration, and provides more details:

In short, all topics up until our HTTPS switchover were created using HTTP links as the topic source. So when we switched over, we needed the **discourseEmbedUrl** variable to continue using HTTP links, otherwise duplicate HTTPS articles were created using the new HTTPS topic source URL.

> [@HTTPS support - Error Embedding](https://meta.discourse.org/t/https-support-error-embedding/68944/1):
>
> var discourseUrl = “https:// discussion.sitename.tld/”, discourseEmbedUrl = “\<?php print 'https:// sitename.tld/node/'.$node-\>nid; ?\>”; (function() { var d = document.createElement(‘script’); d.type = ‘text/javascript’; d.async = true; d.src = discourseUrl + ‘javascripts/embed.js’; (document.getElementsByTagName(‘head’)[0] || document.getElementsByTagName(‘body’)[0]).appendChild(d); })();

> [@HTTPS support - Error Embedding](https://meta.discourse.org/t/https-support-error-embedding/68944/5):
>
> I changed only the first link to HTTPS in the Discourse code block. Since this site is transitioning from HTTP to HTTPS, all previously created topics had a discourseEmbedUrl of **http://** sitename.tld/node/blablabla. Changing that to **https** made the topics appear to be recreated. So I ended up changing only the **discourseUrl** to HTTPS, and leaving the discourseEmbedUrl in HTTP to preserve previous topics.

Sorry for the long explanation; is it possible to have embedded images use a different variable than the source URL for cases like this? It seems like we’re currently stuck with two options:

- Use the same **discourseEmbedUrl** variable (HTTP) for images as we use for the topic source URL, which results in broken images (as they appear to not be delivered properly over HTTP within embeds)

- Change the **discourseEmbedUrl** variable to be HTTPS, and have working images, but also have a duplicate topic created whenever a visitor executes the embed code (as a result of using a different **discourseEmbedUrl** than its counterpart topic source URL)

I can provide additional information if needed – please let me know!

---

_[View the full topic](https://meta.discourse.org/t/images-not-loading-possible-https-issue/149398)._
