As long as it is not http_referer from (google.com google.cn *.google.com *.google.cn baidu.com *.baidu.com) requests from these web site sources, they are forwarded to 404
Copy Code code as follows:
<%
Dim A, Reg
A = Request.ServerVariables ("Http_referer"). Item
Set reg = New RegExp
Reg. Pattern = "^http://(?: [^.] *\.)? (?: google\.com|google\.cn|baidu\.com) (/|$)"
Reg. IgnoreCase = True
If not Reg. Test (a) Then
Set reg = Nothing
Response.Status = "404 File not Found."
Response.End
End If
Set reg = Nothing
' .... Go on
%>
Copy Code code as follows:
<% @LANGUAGE = "VBSCRIPT" codepage= "65001"%>
<%dim Ok_url,url, Http_referer
' Customize the string to be filtered, with ' | ' delimited
ok_url= ' google.com|google.cn|baidu.com ' Exclude information
Ok_url= split (Ok_u RL, "|") ' Split exclusion information
Url= "404.htm" ' Set point to Page
Http_referer=request.servervariables ("http_referer") ' Get Source URL
If http_refere R<> "" Then
for each REFERER in Http_referer
for i=0 to Ubound (ok_url)
If Instr (LCase ( REFERER)), Ok_url (i)) =0 Then ' If the source URL is not the above exclusions, then return directly to the page you are pointing to!
Response.Redirect (URL): Response.End ()
End If
Next
Next
End if%>