Created
December 18, 2013 20:57
-
-
Save niraj-shah/8029713 to your computer and use it in GitHub Desktop.
Checking if Facebook robot is hitting your page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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