5

We are in the process of moving a Ruby On Rails website from HTTP to HTTPS. Our sites uses the fb-comments plugin to capture user comments on various pages. During our testing we found when we switch a page from HTTP to HTTPS Facebook seems to see this as a new page and no longer loads any of the previous comments for the page.

In other words, http://my.domain.com/page1 and https://my.domain.com/page1 are treated as separate pages with different sets of comments by fb-comments.

Here's a snippet of our HTML that includes the current call to fb-comments:

<div class="fb-comments"
     data-href="<%=url_for(:only_path=>false)%>"
     data-num-posts="<%=number_of_posts%>"
     data-width="<%=width%>">
</div>

Does any know the correct way to get Facebook to return the comments for the page regardless of the protocol (HTTP vs. HTTPS)?

Doug Couvillion
  • 1,071
  • 10
  • 13

3 Answers3

3

According to my testing you need to remove 'http://' and 'https://' from fb-comments, so I use this block:

<div class="fb-comments" data-href="www.mydomain.com/page1.html"></div>
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Henrik R.
  • 183
  • 8
1

The only way to keep the comments afaik is to use the http URL in the data-href parameter. I don´t think there are any downsides to this.

andyrandy
  • 72,880
  • 8
  • 113
  • 130
0

Use:

<div class="fb-comments" data-href="my.domain.com/page1" data-numposts="5" data-width="100%" colorscheme="dark"></div>

It is the best way to ignore your domain prefix.

Sagor Chowdhuri
  • 233
  • 2
  • 5