中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

網(wǎng)站如何防復制,防采集

2018-11-01    來源:學做網(wǎng)站論壇

容器云強勢上線!快速搭建集群,上萬Linux鏡像隨意使用

自己建好了網(wǎng)站,但是如果不做處理,自己網(wǎng)站上的內容很容易被別人復制到其它網(wǎng)站上,對于自己網(wǎng)站的SEO優(yōu)化不利。

更有甚者,很多人采用采集軟件瘋狂的采集我們網(wǎng)站內容,不但竊取了我們網(wǎng)站的內容,而且還嚴重增加了網(wǎng)站服務器的負擔。為了解決這個問題,學做網(wǎng)站論壇講過網(wǎng)站如何做防盜鏈設置。

網(wǎng)站如何防復制,防采集

今天我們來講一下如何防止別人去復制,采集自己網(wǎng)站的內容,方法很簡單,只需要復制以下的代碼放在模板文件頂部即可。

一,防復制粘貼:

<% '作用:文字防復制亂碼 函數(shù)
'Date:2006-3-6
'作者:https://www.xuewangzhan.com/
'參數(shù)str 為原文,str1作者也是你自己,reslut產生亂碼的種子
Function ReadToCode(str,Str1,result)
dim name
dim i,j,k
If isnull(str) then
ReadToCode=""
Exit Function
End If
Randomize
k=instr(str,"</P>")
Do while k>0
result=""
for i=0 to 19
j=Int(128 * Rnd)+1
if j=60 or j=62 then
j=j+1
end if
result =result&chr(j) ' 產生隨機數(shù)。
next
result="<span style='DISPLAY: none'>"&result&"</span>"
str=replace(str,"</p>",result&"<'/p>",1,1)
k=instr(str,"</p>")
loop
str=replace(str,"<'/p>","</p>")
k=instr(str,"<br>")
Do while k>0
result=""
for i=0 to 19
j=Int(128 * Rnd)+1
if j=60 or j=62 then
j=j+1
end if
result =result&chr(j) ' 產生隨機數(shù)。
next
result="<span style='DISPLAY: none'>"&result&"</span>"
str=replace(str,"<br>",result&"<'br>",1,1)
k=instr(str,"<br>")
loop
str=replace(str,"<'br>","<br>")
ReadToCode=str&"<div align=right style='color=gray'>[版權歸原作者及"&Str1&"共同擁有,轉載請注明出處]</div>"
End Function

Dim a
a="嘿嘿,一篇<br>不錯的好<p>文章哦</P><br><P>我艸,版權所有。</p>"

'Only For Test
response.write (a)
Dim b
'為配合轉換,字符串a的大小都替換成小寫
b=ReadToCode(LCase(a),"blue2004","www.net.cn")
'Output
response.write b
%>

二、防采集:防止網(wǎng)站內容被人小偷和采集的ASP代碼

<%
Dim AppealNum,AppealCount
AppealNum=10 '同一IP60秒內請求限制10次
AppealCount=Request.Cookies("AppealCount")
If AppealCount="" Then
response.Cookies("AppealCount")=1
AppealCount=1
response.cookies("AppealCount").expires=dateadd("s",60,now())
Else
response.Cookies("AppealCount")=AppealCount+1
response.cookies("AppealCount").expires=dateadd("s",60,now())
End If
if int(AppealCount)>int(AppealNum) then
response.write "抓取很累,歇一會兒吧!"
response.end
End If
%>

標簽: isp seo 代碼 服務器 網(wǎng)站服務器

版權申明:本站文章部分自網(wǎng)絡,如有侵權,請聯(lián)系:west999com@outlook.com
特別注意:本站所有轉載文章言論不代表本站觀點!
本站所提供的圖片等素材,版權歸原作者所有,如需使用,請與原作者聯(lián)系。

上一篇:網(wǎng)站幻燈片的尺寸怎么改

下一篇:如何用wordpress程序做論壇網(wǎng)站