In the Support category, sckott reports that their Discourse embed is creating duplicate topics for blog posts at https://ropensci.org/blog/, likely because both http and https versions of the site are accessible without redirects. Falco identifies the root cause: Discourse treats http and https URLs as separate, triggering new topic creation for each. A suggested fix is implementing 301 redirects from http to https and enabling HSTS headers. sckott asks if the embed code can be modified to only use https, but Falco advises fixing the redirects instead, as the embed code’s discourseEmbedUrl should already enforce https. sckott thanks them, and later references a related meta thread 6, which codinghorror clarifies is unrelated. sckott offers to remove the link. Finally, techAPJ confirms the issue has been resolved in Discourse core via commit 9030d3e, which now handles http/https duplicates gracefully.
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 ) Duplicates seem to be created every few hours now.
Makes sense, yep, 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?