Block facebook from my website

Posted by Joseph Szymborski on Stack Overflow See other posts from Stack Overflow or by Joseph Szymborski
Published on 2011-11-19T17:00:05Z Indexed on 2011/11/22 9:50 UTC
Read the original article Hit count: 270

Filed under:
|
|
|
|

I have a secure link direction service I'm running (expiringlinks.co). If I change the headers in php to redirect my visitors, then facebook is able to show a preview of the website I'm redirecting to when users send links to one another via facebook. I wish to avoid this. Right now, I'm using an AJAX call to get the URL and javascript to redirect, but it's causing problems for users who don't use javascript.

Here are a number of ways I'd like to block facebook, but I can't seem to get working:

  1. I've tried blocking the facebook bot (facebookexternalhit/1.0 and facebookexternalhit/1.1) but it's not working, I don't think they're using them for this functionality.

  2. I'm thinking of blocking the facebook IP addresses, but I can't find all of them, and I don't think it'll work unless I get all of them.

  3. I've thought of using a CAPTCHA or even a button, but I can't bring myself to do that to my visitors. Not to mention I don't think anyone would use the site.

  4. I've searched the facebook docs for meta tags that would "opt-me out", but haven't found one, and doubt that I would trust it if I had.

Any creative ideas or any idea how to implement the ones above? Thank you so much in advance!

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript