# discourseEmbedUrl and Joomla

**URL:** https://meta.discourse.org/t/discourseembedurl-and-joomla/92039
**Category:** Support
**Created:** [July 11, 2018, 1:10am UTC](https://meta.discourse.org/t/discourseembedurl-and-joomla/92039 "2018-07-11T01:10:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![developer\_zero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/developer_zero/32/100858_2.png) [@developer\_zero](https://meta.discourse.org/u/developer_zero)
#### Post date: [July 11, 2018, 1:10am UTC](https://meta.discourse.org/t/discourseembedurl-and-joomla/92039/1 "2018-07-11T01:10:18Z")

</div>

I have successfully used embedding to link my joomla website with discourse. Well, sort of successfully! It works well however I have an issue with discourseEmbedUrl. At the moment I’m using:

`discourseEmbedUrl: window.location.href };`

Which works great for the most part:wink: However, this solution also creates new topics for URLs which include URL Query String Parameters. So for example this creates two new discourse topics for a single article URL:

```
https://example.com/artcile1
and
https://example.com/artcile1?somequerystring

```

I can clean the Query String Parameters for each URL using nginx redirection however this breaks the website’s search etc.

I’m not very proficient in javascript nor PHP but I’m sure that there must be a better solution to this issue. Any suggestion on how to better define my discourseEmbedUrl with Joomla CMS?

Any help is much appreciated… Thank you

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [July 11, 2018, 7:08am UTC](https://meta.discourse.org/t/discourseembedurl-and-joomla/92039/2 "2018-07-11T07:08:48Z")

</div>

You can use the below code. It will remove the query string from URL.

`discourseEmbedUrl: window.location.href.split(/[?#]/)[0] };`

---

<div class="post-metadata">

### Author: ![developer\_zero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/developer_zero/32/100858_2.png) [@developer\_zero](https://meta.discourse.org/u/developer_zero)
#### Post date: [July 11, 2018, 11:15pm UTC](https://meta.discourse.org/t/discourseembedurl-and-joomla/92039/3 "2018-07-11T23:15:20Z")

</div>

Thank you. Works as expected…!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [August 10, 2018, 11:15pm UTC](https://meta.discourse.org/t/discourseembedurl-and-joomla/92039/4 "2018-08-10T23:15:23Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
