2
votes

I have 3 URL's that all lead to the same page for example:

www.example.com/index.php?q=8236894
www.example2.com/index.php?q=8236894
www.example3.com/index.php?q=8236894

Because the query string "q" are all the same, I want them all to load the same disqus thread. Any ideas on how to achieve this?

2

2 Answers

3
votes

Old thread, but I had the same problem so I figured I'd share my solution!

The link pedrum golriz provided is helpful. We implemented it here: www.learnerds.com

On the destination page, we used this code:

<script>

var url = window.location.href;   \\ grabs the complete url with the query strings
var temp = new Array();  \\ creates an array that will store our values
temp = url.split('?');   \\ this function splits the url into 2 parts 
                         \\ temp[0] (everything before the question mark) & temp[1] (everything after the question mark)
disqus_url = temp[0];   \\sets the disqus_url to be the same regardless of query strings

</script>

You could also probably do window.location.href.split('?')[0] for less lines of code.

Hope that helps!

0
votes

The disqus documentation found here http://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables should help.

Basically, make sure you set the discus_* variables to the same values. Also, all sites need to be added to your list of "trusted domains" (or, the list needs to be empty).