Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created December 18, 2013 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niraj-shah/8029713 to your computer and use it in GitHub Desktop.
Save niraj-shah/8029713 to your computer and use it in GitHub Desktop.
Checking if Facebook robot is hitting your page
if ( strstr( $_SERVER['HTTP_USER_AGENT'], 'facebookexternalhit' ) {
// show OpenGraph headers for page
} else {
// Password protected page / login page
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment