作为新站长,如果自己的网站没有被百度等搜索引擎收录,该怎么办?继续发外链吗?甚至是一些垃圾外链吗?笔荨层吒椋者建议不要这样,因为你的网站没有被收录,可能是你网站的问题,而不是蜘蛛没有来过。
与其浪费时间发些垃圾外链,不如用心优化一下自己的网站。如何知道自己的网站到底有木有蜘蛛有来过。
笔者告诉一个简单的方法,这里以php网站为例。
首先将下面的一段代码保存为demo.php,当然你换个名字也无所谓的,这里仅仅是举个例子。<?php
function get_naps_bot(){ $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); if (strpos($useragent, 'googlebot') !== false){ return 'Googlebot'; }if (strpos($useragent, 'sohu-search') !== false){ return 'Sohubot'; } if (strpos($useragent, 'msnbot') !== false){ return 'MSNbot'; } if (strpos($useragent, 'baiduspider') !== false){ return 'Baiduspider'; }
return false;}
function nowtime(){ $date=date("Y-m-d.G:i:s");
return $date;}
$searchbot = get_naps_bot();
if ($searchbot) { $tlc_thispage = addslashes($_SERVER['HTTP_USER_AGENT']); $url=$_SERVER['HTTP_REFERER']; $file="dinmo.txt"; $time=nowtime(); $data=fopen($file,"a"); fwrite($data,"Time:$time robot:$searchbot URL:$tlc_thispage "); fclose($data);}?>
第二步,将demo.php上传到你网站根目录,同时在模板页加入:<?php include('dinmo.php') ?>
第三步,有蜘蛛访问以后输入http://你的网站/dinmo.txt 就可以看到蜘蛛了 如果404 就是蜘蛛还没来
记录的很清楚吧!如果这个文件可以查看目前几乎所有蜘蛛的爬行记录!