Search engine spider sorting_PHP tutorial

WBOY
Release: 2016-07-21 14:55:52
Original
1048 people have browsed it

Baidu

The user agent of Baidu’s spider will contain the Baiduspider string.

Related information: http://www.baidu.com/search/spider.htm

google

Google’s spider user agent will Contains the Googlebot string.

Related information: http://www.google.com/bot.html

soso

Soso’s spider’s user agent will contain Sosospider String

related information: http://help.soso.com/webspider.htm

sogou

sogou’s spider user agent will Contains Sogou web spider string

Related information: http://www.sogou.com/docs/help/webmasters.htm#07

Others are similar. . . You can check the access log of the website by yourself.

How to control the behavior of spider through php program?

Get the visitor's user agent through $_SERVER["HTTP_USER_AGENT"], then determine whether it contains the specific string of the corresponding search engine spider, and then take subsequent actions.

$user_agent = $_SERVER["HTTP_USER_AGENT"];

if ( eregi("Googlebot",$user_agent) )
{
// is google's spider access, you can do something for it~
}
?>
$user_agent = $_SERVER["HTTP_USER_AGENT"];

if ( eregi("Googlebot ",$user_agent) )

{ } ?> http://www.bkjia.com/PHPjc/364382.htmlwww.bkjia.comtrue
http: //www.bkjia.com/PHPjc/364382.htmlTechArticle
The user agent of Baidu’s spider will contain the Baiduspider string. Related information: http://www.baidu.com/search/spider.htm Google Google’s spider user agent will contain Googl...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template