how to identify web crawlers of google/yahoo/msn by PHP?

前端 未结 8 1599
清酒与你
清酒与你 2020-12-29 17:51

AFAIK,

$_SERVER[\'REMOTE_HOST\'] should end up with \"google.com\" or \"yahoo.com\".

but is it the most ensuring method?

any other way out?

8条回答
  •  情书的邮戳
    2020-12-29 18:11

    You are probably better off using $_SERVER['HTTP_USER_AGENT'] and look for Googlebot or Yahoo! Slurp.

提交回复
热议问题