How to take over Facebook and Hateb when redirecting from http to https!
If you redirect from http to https when SSL is always introduced, Facebook likes and Hatena bookmarks will return to zero as the URL changes.
I will show you how to take over this.Facebook
Although it is also posted on Facebook’s official website , change og: url to “http: // ~” and exclude https: // redirects from http: // only for Facebook crawlers.Set HTML og: url to http: // ~<meta property = “og: url” content = “http://example.com/”>Edit .htaccess<IfModule mod_rewrite.c> RewriteEngine on RewriteCond% {HTTP_USER_AGENT}! (Facebot | facebookexternalhit / 1.1) [NC] RewriteCond% {HTTPS} off RewriteRule ^ (. * $) Https://knowledge.cpi.ad.jp/$1 [R = 301, L] </ IfModule> The third line is a description that excludes Facebook crawlers, otherwise it is a method to redirect http: // ~ to https: // ~.