Keyword

Loosing Facebook Likes when changing form HTTP to HTTPS

  • Adrian Diehm
  • Adrian Diehm's Avatar Topic Author
  • Offline
  • New Member
More
7 years 7 months ago #160284 by Adrian Diehm
With the recent release of Chrome 56, making the transition from HTTP to HTTPS will wipe out your Facebook Likes because FB sees HTTP and HTTPS as 2 separate sites.

To only way to retain your FB likes is to change the OG:URL content to HTTP

You can fix this by making the following core changes that replace the "HTTPS" in the OG:URL with "HTTP"

Category View:
/public_html/components/com_k2/views/itemlist/view.html.php
line 731 change
from : $document->setMetaData('og:url', $uri->toString());
to: $document->setMetaData('og:url', str_replace( "https", "http",$uri->toString()));

Item View:
/public_html/components/com_k2/views/item/view.html.php
line 569 change
from : $document->setMetaData('og:url', $uri->toString());
to: $document->setMetaData('og:url', str_replace( "https", "http",$uri->toString()));

Latest Items:
/public_html/components/com_k2/views/latest/view.html.php
make the same changes to line 276 (untested)

The only side effect i have seen is the FB Debugger will report a circular redirect path if you also have a 301 redirect in place for HTTP to HTTPS. WHilst FB Debugger reports this as a Warning it does not seem to impact the outcome.

Note: Don't forget to fill in the Meta Information / Description for each Category as this becomes the OG:Description

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum