Reputation: 30731
I am trying to get my meta tags right for certain pages, and in order to do that I need to trick facebook into reading a different header.
How can I detect if user is infact Facebook's spider/crawler on the prowl for meta tags?
Upvotes: 4
Views: 210
Reputation: 1877
the $_SERVER['HTTP_USER_AGENT']
variable tells you that. It's usually something like this facebookexternalhit/1.0 ( http://www.facebook.com/externalhit_uatext.php)
if it is facebook reading your site
Upvotes: 4