After switching to https://, all of our articles have lost their Facebook \"Like\" count. So I would like to disable https just for the Content area of our website, which is at
I found a way to fix this, without making content.php be unsecure. The Facebook "Like" HTML code looks like this:
<fb:like href="https://www.mysite.com/{vb:raw relpath}" font="tahoma" layout="standard" show_faces="false" width="260" action="like" colorscheme="light"></fb:like>
I use vBulletin. I changed it to http, and everything is fine now!
You can use this code:
RewriteEngine on
# uri is not /content.php
RewriteCond %{REQUEST_URI} !^/content\.php$ [NC]
# https is off
RewriteCond %{HTTPS} off
# redirec to https site
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
There is a very easy solution: with the og:url
meta tag:
<meta property="og:url" content="http://example.com/old-url" />
You can read more about that into the FAQ section: https://developers.facebook.com/docs/plugins/faqs
The section is called: How do I move a page to a different URL?
You'll need to make a change to your first rule to exclude content.php
. The you simply add a rule for content.php
that will do exactly the opposite of your other rule. You can add the [R=301]
flag if your rules do what you expect them to do to turn them into permanent redirects. Permanent redirects are cached by the browser and will reduce the amount of requests done to your server. You don't need to use a capturing group for your first rule, and therefore I just used the ^
syntax, which matches every request.
RewriteEngine on
#Turn the entire site into https, except for content.php
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/content\.php$
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
#Use http instead for this url
RewriteCond %{HTTPS} on
RewriteCond ^content\.php$ http://%{HTTP_HOST}%{REQUEST_URI}