Posted in Code on September 3rd, 2014

Force HTTPS with Github Pages

After mucking about in the Disqus admin panel for too long, I realized that the reason that certain comments on the site were showing up in the panel but not on the site was that Disqus (perhaps rightfully) sees a single page via two different protocols as... two different pages. That's right, comments left on won't show on

For now, the only way around it for GitHub Pages seems to be some javascript hackery forcing all pages to use HTTPS (desirable even without the comment issue):

    var host = '';
    if ( == host && window.location.protocol != 'https:') { 
        window.location.protocol = 'https:';