Forum Moderators: phranque

Message Too Old, No Replies

Ban IP address

Iis5

         

Marketing Guy

11:24 am on Feb 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all

I know this has no doubt been covered many a time, but I cant find any threads on it.

I tried site search a couple of times, but dont really know what other terms to search for! :)

Can someone point me in the direction of a thread / site that explains how to ban a specifc IP address from accessing a site?

Cheers
Scott

hakre

12:06 pm on Feb 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you can use .htacces for this. the following code will perform a not allowed error:

Order Allow,Deny
Allow from all
Deny from 215.186.120.47

this will block 215.186.120.47. you can add even more deny lines or use regular expressions on it (enable regex with ~).

thread on deny and apache [webmasterworld.com]

you can also use the sitesearch with the term 'deny ip'.

Marketing Guy

12:28 pm on Feb 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thats great!

Thanks a lot :)

Scott

Marketing Guy

12:36 pm on Feb 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah one more thing - is it possible to bring up a custom error page when the site is accessed from blocked IP's?

</evil grin>

Cheers
Scott

stevedob

12:54 pm on Feb 27, 2003 (gmt 0)

10+ Year Member



Oh yes :)

In the .htaccess file, add

ErrorDocument 403 /your_custom_forbidden.html

The previously mentioned 'deny from ..' will cause the server to issue a 403 status code, which you direct to your custom document.

Note that your host may already have provided for this, in which case you only need to update their custom document.

Marketing Guy

1:03 pm on Feb 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<glee> Oooh cheers! :) </glee>

Scott

diddlydazz

1:25 pm on Feb 27, 2003 (gmt 0)

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



are you talking about an IIS box or Apache?

<added>If you are asking about IIS then .htaccess isnt an option</added>

Dazz

Marketing Guy

2:57 pm on Feb 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah it is IIS5....:(

What are the alternatives?

Scott

hakre

8:33 am on Feb 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



my fault, have passed the small line under discussion title. ups. i'm not familiar with iis5, so no idea. as i remember correctly, ip blockings can be setup per server node (in iis4 with the managment console). with error pages it was the same. rightclick on the server node and set the options.