# Embed creating duplicate http / https topics

**URL:** https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113
**Category:** Support
**Created:** [May 4, 2017, 4:00pm UTC](https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113 "2017-05-04T16:00:37Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![sckott](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sckott/32/115359_2.png) [@sckott](https://meta.discourse.org/u/sckott)
#### Post date: [May 4, 2017, 4:00pm UTC](https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113/1 "2017-05-04T16:00:37Z")

</div>

First, thanks for Discourse - awesome product.

I’m using embed in this category [https://discuss.ropensci.org/c/blog](https://discuss.ropensci.org/c/blog) for comments on our blog at [rOpenSci | Blog](https://ropensci.org/blog/)

After first implementing the embed, it worked great. Recently, our forum has been creating duplicate topics (which I try to quickly delete to minimize annoying our users). Any thoughts on why duplicate topics are showing up?

I wonder if it’s at all related to how we make our site. We use Jekyll, render locally, then push to a server. I wonder if something about the way we update our site makes our forum think there’s a new topic to create even though the blog post linked to that topic is already linked to a topic already created.

Maybe there’s a way to prevent duplicate topics from being created as a work-around?

p.s. Duplicates were just created for three blog posts (the top 3 here [https://discuss.ropensci.org/c/blog](https://discuss.ropensci.org/c/blog) ) Duplicates seem to be created every few hours now.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [May 4, 2017, 4:25pm UTC](https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113/2 "2017-05-04T16:25:03Z")

</div>

It’s one for the `http` and one for the `https` version of the blog.

I believe if you add proper redirects (http sends 301 to https + HSTS headers) it won’t happen.

---

<div class="post-metadata">

### Author: ![sckott](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sckott/32/115359_2.png) [@sckott](https://meta.discourse.org/u/sckott)
#### Post date: [May 4, 2017, 4:28pm UTC](https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113/3 "2017-05-04T16:28:18Z")

</div>

Makes sense, yep, [ropensci.org](http://ropensci.org) still allows both `http` and `https` without redirecting `http` to `https`

Is there a way to in the meantime to make a fix in the embed code? Like only create a topic for `https` version of the URL? I have `https` hard-coded below, but I guess that doesn’t do it?

this is the code we have now:

```html
<script type="text/javascript">
  DiscourseEmbed = { discourseUrl: 'https://discuss.ropensci.org/',
                     discourseEmbedUrl: 'https://ropensci.org{{ page.url }}' };

  (function() {
    var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
    d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
  })();
</script>

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [May 4, 2017, 4:50pm UTC](https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113/4 "2017-05-04T16:50:11Z")

</div>

I think it’s easier to fix the redirects than to find why our embed code is ignoring the `discourseEmbedUrl` somewhere.

---

<div class="post-metadata">

### Author: ![sckott](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sckott/32/115359_2.png) [@sckott](https://meta.discourse.org/u/sckott)
#### Post date: [May 4, 2017, 4:53pm UTC](https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113/5 "2017-05-04T16:53:37Z")

</div>

Okay, thanks for your help.

---

<div class="post-metadata">

### Author: ![sckott](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sckott/32/115359_2.png) [@sckott](https://meta.discourse.org/u/sckott)
#### Post date: [May 4, 2017, 7:11pm UTC](https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113/6 "2017-05-04T19:11:04Z")

</div>

See also [Embed Discourse comments on another website via Javascript - #174](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963/174)

---

<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: [May 4, 2017, 7:55pm UTC](https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113/7 "2017-05-04T19:55:58Z")

</div>

That is not the same issue, that is about the “Show full post” button not duplicate topics.

---

<div class="post-metadata">

### Author: ![sckott](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sckott/32/115359_2.png) [@sckott](https://meta.discourse.org/u/sckott)
#### Post date: [May 4, 2017, 8:21pm UTC](https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113/8 "2017-05-04T20:21:26Z")

</div>

want me to remove the link?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [January 4, 2018, 8:11pm UTC](https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113/9 "2018-01-04T20:11:24Z")

</div>

> [@Falco](#):
>
> It’s one for the http and one for the https version of the blog.

This is now fixed via:

> <https://github.com/discourse/discourse/commit/9030d3ef6316431da2e070d1449acb90da57c4b8>
>
> https://meta.discourse.org/t/duplicate-http-https-topics-are-randomly-created/77…190

---

<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: [January 4, 2018, 10:22pm UTC](https://meta.discourse.org/t/embed-creating-duplicate-http-https-topics/62113/10 "2018-01-04T22:22:48Z")

</div>


