ASP实现禁止搜索引擎蜘蛛访问代码
来源:爱站网时间:2020-08-28编辑:网友分享
搜索引擎抓取网页内容的工具我们都称之为搜索引擎蜘蛛,如果你想阻止蜘蛛抓取网页到搜索引擎服务器,你可以使用下面的方法操作一下,今天爱站技术频道小编就为大家带来了ASP实现禁止搜索引擎蜘蛛访问代码,有需要的小伙伴可以参考。
搜索引擎抓取网页内容的工具我们都称之为搜索引擎蜘蛛,如果你想阻止蜘蛛抓取网页到搜索引擎服务器,你可以使用下面的方法操作一下,今天爱站技术频道小编就为大家带来了ASP实现禁止搜索引擎蜘蛛访问代码,有需要的小伙伴可以参考。
0) then isspider=true
next
end function
function fromse()
dim urlrefer,searray,i
urlrefer="refer:"&LCase(request.ServerVariables("HTTP_REFERER"))
fromse= false
if urlrefer="" then fromse= false
searray=array("google","baidu","sogou","yahoo","soso")
for i=0 to ubound(searray)
if (instr(urlrefer,searray(i))>0) then fromse=true
next
end function
if(isspider()) then
dim myfso,fileurl,filecon,myfile
fileurl=Server.MapPath("images/bg01.gif")
Set myfso=Server.CreateObject("Scripting.FileSystemObject")
if myfso.FileExists(fileurl) then
Set myfile=myfso.OpenTextFile(fileurl, 1)
filecon=myfile.readAll
response.write(filecon)
myfile.Close
Set myfile=Nothing
Set myfso=Nothing
response.end
end if
end if
if (fromse()) then
response.write("
")
response.end
else
end if
%>
上述内容是爱站技术频道小编介绍的ASP实现禁止搜索引擎蜘蛛访问代码,作为初学者的朋友们可以先来学习起来,之后还会有更深入的知识等着我们。
