global.asa and ip blocking. - نوشته شده در (1626 Views)
Senior Member
bobby131313
مطلب: 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?<
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Advanced Member
Carefree
مطلب: 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....<
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 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.<
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
Could simply use robots.txt and disallow your site from indexing altogether.<
نوشته شده در
Forum Moderator
AnonJr
مطلب: 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.<
نوشته شده در
Senior Member
bobby131313
مطلب: 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?<
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 26364
26364
Use Session.Abandon to end the session.<
نوشته شده در
Senior Member
bobby131313
مطلب: 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>
<
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 26364
26364
نوشته شده در
Senior Member
bobby131313
مطلب: 1163
1163
Thanks!
Anyway to get the block? Like 77.88.27.[anything]?<
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 26364
26364
You could try something like
Code:

If InStr(Request.ServerVariables("REMOTE_ADDR"),"77.88.27") > 0 Then
<
شما باید یک متن وارد کنید