Topic-icon https url are not showing comments for http and vice-versa

Active Subscriptions:

None
My website is going-natural.com/ and my website has both http and https enabled. so when user visits using https so jfb shows comments for https url only not for http and vice-versa. For example you can check the below given links both links are same except http and https. They should show comments from both https and http on each page.

going-natural.com/nappy-news-blog/cyber-monday-giveaway.html
going-natural.com/nappy-news-blog/cyber-monday-giveaway.html

Please help me
The topic has been locked.
Support Specialist
That's (what we consider) to be a bug with Facebook. It was originally reported back in May in this Facebook bug report . The problem is simply that Like's and Comments are tied to a specific URL and Facebook treats https and http as different URLs.

Unfortunately, the bug-report didn't get much traction and will likely never be fixed on their end. In a future JFBConnect release, we'll likely have a switch that an admin can say "All social widgets should use http" (or https). That will consolidate the Like's and Comments that can be spread across both variants of the URL. Until then, if you want to make a quick change, it should hard-code the protocol to whichever you'd prefer for the links that get posted in Facebook and keep the comments and Like's together, regardless of which page a user views.

The edit is in the /libraries/sourcecoast/utilities.php file. In the getStrippedUrl function, around line 196, you'll see:
if ($query)
            $href .= '?' . $query;

        return $href;
Edit that so it looks like:
if ($query)
            $href .= '?' . $query;

        $href = str_replace('https', 'http', $href);
        return $href;
That will force all URLs in the social widgets to http. You can switch the ordering of the 2 as well, if you'd prefer https.

Hope that helps, but keep us posted if you have any other questions,
Alex
The topic has been locked.
Active Subscriptions:

None
Ok but that will not be the solution because as all the comments will go on http: after that change but suppose if user opens the website using https so no comment will be shown on that url because all comments will on http url
The topic has been locked.
Support Specialist
No, I think you're mis-understanding. Each Like or Comment is attributed to a specific URL from your site. By making that change, it will simply update your social widgets to always us the non-https URL *just* for those widgets. So, even if a user visits the SSL version of your page, the Comments shown will be from the non-https page and if they comment it will 'go' to the non-https version. The https page will work just fine and still show comments and, frankly, the user won't know a difference. The only thing that will happen is the post to a user's wall that leads back to your site will be non-https, but I think that should be fine.

Hope that helps explain, but if not, let us know!

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
I did what you said but it did not worked

File Attachment:


so i corrected the issue by editing easytags.php file and i changed the code
if ($href)
$commentString .= ' href="' . str_replace('https', 'http', $href) . '"';
else if ($xid) //Use deprecated xid to keep old comments: developers.facebook.com/blog/post/472
$commentString .= ' xid="' . $xid . '" migrated="1"';
else
{
$url = SCSocialUtilities::getStrippedUrl();
$commentString .= ' href="' . str_replace('https', 'http', $url) . '"';
}
The topic has been locked.
Support Specialist
Not sure why editing the code after getStrippedUrl fixed the issue when just editing the return from that same function worked.. however, I'm not going to argue. Hopefully, what you came to as a solution works well for you. It seems like it should have the same desired effect of what we were suggesting, so that's great.

Of course, if you still run into issues or have any questions, just let us know!

Thanks,
Alex
The topic has been locked.