Problem with hashbang URLs

386 views
Skip to first unread message

Allov

unread,
Feb 6, 2012, 8:56:36 AM2/6/12
to disqu...@googlegroups.com
Hi,

We're having problems setting up DISQUS with AJAX driven site. When ever sending an URL either in the disqus_url global variable or the DISQUS.reset function, if a #! is present in the URL, it doesn't work and displays this message:

We were unable to load Disqus. For more information please see our documentation on identifier and urls. We encountered the following error(s):
Could not connect to URL: "http://example.com/#!/famille-williams" (error was "HTTP Error 400: Bad Request")

If we switch URLs to the domain (without hashbang) it creates thread correctly. Also, if the thread has been created with a correct url, passing the URL with or without hashbang works as it seems to use the unique identifier.

We're using these global variables to initialize:

var disqus_title,
    disqus_shortname,
    disqus_url,
    disqus_identifier;

We also made sure to pass the correct data as per these recommendations (http://docs.disqus.com/help/83/). 


neoascetic

unread,
Mar 26, 2012, 5:14:51 AM3/26/12
to disqu...@googlegroups.com
I faces with same problem (except that Disqus report about 404 error).
I found that Disqus crawler (which ping URL specified in `disqus_url` variable) trying to get from server page by path, that contains hash (fragmet) part too (`GET /#some_stuff`, for example). See http://tools.ietf.org/html/rfc2396#section-4 for details. By default server must ignore fragment part, so it is problem of your server that it give 400 instead of document located by '/'. In my case, I'm used mini-httpd as a webserver, and it give me 404 errors. When I moved to lighthttpd, errors gone.

BUT I faced with another problem described here: https://groups.google.com/forum/#!msg/disqus-dev/48F6uFAMwYA/UXX37OY7BX4J
DISQUS team, please do some checking for hashbang in page URL before displaying it in moderation panel.

Thx for your work!

Allov

unread,
Mar 27, 2012, 10:15:52 AM3/27/12
to disqu...@googlegroups.com
Yeah, well, I recently changed my approach to also support pretty url (without hashbang), where I redirect to the hashbang version:


But, it's also giving me a 400. But, when I type the url myself, I don't get any bad request at all. I don't know what they are using, but, it's some strange request.
Reply all
Reply to author
Forward
0 new messages