Forum Moderators: phranque

Message Too Old, No Replies

Banning an IP on a IIS box?

I would like to redirect them

         

diddlydazz

6:18 pm on Aug 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



is it possible ?

I know .htaccess but this site is running on an IIS 5.0 box.

Thanks in advance :)

Dazz

korkus2000

6:21 pm on Aug 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use your global.asa but the pages have to be processed by your IIS. If they are html or htm pages you need to add those to your IIS documents.

here is what I do.
[webmasterworld.com...]

you can also set up an ISAPI filter. Don't ask me how though :)

diddlydazz

6:27 pm on Aug 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi korkus2000,

could you give me an example (easy one ;))

I want to ban from the entire site and redirect to somewhere else:)

I don't know anything about IIS or Global.asa

It is quite urgent as there is someone copying the site and I want to stop them ASAP.

Thanks Korkus

Dazz

korkus2000

6:37 pm on Aug 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are your pages .asp?
If not you have to add htm and html to be processed by the IIS.

Save file as global.asa and save it on your root. You can only have one global.asa per IIS web site instance. Make sure noone else in your website folder has one or they can collide.

<script language="vbscript" runat="server">

sub Session_OnStart
dim remote_host
remote_host = request.ServerVariables("REMOTE_HOST")
If remote_host = IP of offender
Then Response.Redirect("http://www.yahoo.com")
End If
end sub

</script>

I can't say for certain if this will work. I would test it first out of production.

Global.asa can do some funky stuff. It can stay in memory after one execution and you need a restart to free it up. It may need a restart just to work. Be careful. I don't want you to go down. Do some google searches on global.asa to make sure you understand that it effects everything.

diddlydazz

7:46 pm on Aug 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks Korkus thats great

I will give it a go ;)

Thanks again :)

Dazz

korkus2000

7:49 pm on Aug 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



also check out xoc's fix:

[webmasterworld.com...]

just remember to be careful. I don't want to see you have to restart or have any down time. Let me know how it goes.