global.asa and ip blocking. - Postet den (1628 Views)
Senior Member
bobby131313
Innlegg: 1163
1163
I have this darn Yandex bot chewing up about 6GB a month in bandwidth indexing my site for an all Russian search engine. First let me say... duh.
Second, I found this global.asa code doing a Google search...
<script language="VBScript" RUNAT="SERVER">
Sub Session_OnStart
If Request.ServerVariables("REMOTE_ADDR") = "77.88.27.25" Then
Response.Redirect "http://www.yandex.com/"
End If
End Sub
</script>

Supposedly this will redirect this guy right back to itself.
What do you guys think? Look good? Is there a better solution?<
   
 Sidestørrelse 
Postet den
Advanced Member
Carefree
Innlegg: 4224
4224
Well, you COULD point him to cia.gov, fbi.gov, whitehouse.gov, or to dod.gov and see how long he stays online lol....<
Postet den
Snitz Forums Admin
ruirib
Innlegg: 26364
26364
Why do it in global.asa? Want to stop him from accessing the all the site altogether and not just the forum?
You could also end the session, no reason to have one more session wasting server memory.<
Postet den
Advanced Member
Carefree
Innlegg: 4224
4224
Could simply use robots.txt and disallow your site from indexing altogether.<
Postet den
Forum Moderator
AnonJr
Innlegg: 5768
5768
Originally posted by Carefree
Could simply use robots.txt and disallow your site from indexing altogether.
That only works if the browser respects the robots.txt file - unfortunately not all do.<
Postet den
Senior Member
bobby131313
Innlegg: 1163
1163
You could also end the session, no reason to have one more session wasting server memory.

That sounds awesome. How do I go about doing that?<
Postet den
Snitz Forums Admin
ruirib
Innlegg: 26364
26364
Use Session.Abandon to end the session.<
Postet den
Senior Member
bobby131313
Innlegg: 1163
1163
Like so? ....
Code:
<script language="VBScript" RUNAT="SERVER">
Sub Session_OnStart
If Request.ServerVariables("REMOTE_ADDR") = "77.88.27.25" Then
Session.Abandon
End If
End Sub
</script>
<
Postet den
Snitz Forums Admin
ruirib
Innlegg: 26364
26364
Postet den
Senior Member
bobby131313
Innlegg: 1163
1163
Thanks!
Anyway to get the block? Like 77.88.27.[anything]?<
Postet den
Snitz Forums Admin
ruirib
Innlegg: 26364
26364
You could try something like
Code:

If InStr(Request.ServerVariables("REMOTE_ADDR"),"77.88.27") > 0 Then
<
Du må legge inn en melding