Shopping Cart

Your cart is empty
Comments
Blog
Home : Blog : Htaccess : Blocking Users By IP Or IP Blocks .Htaccess Code

Blocking Users By IP Or IP Blocks .Htaccess Code

E-mail
User Rating: / 0
PoorBest 
Htaccess
Saturday, 07 July 2007 07:12

Is there somebody who is giving you a hard time? Is he kind of stalking your site from hic computer. Well we have a cure for that. Block him, that pesky man.

You can add following code into your .htaccess file where you insert his IP's

order allow,deny
deny from 123.50.6.4
deny from 012.37.6.
allow from all


You can either deny access for an IP address of IP block You can deny access based upon IP address or an IP block. The result will be blocked access from the following IPs 123.50.6.4 and from any sub domain under this IP block 012.37.6. (012.37.6.1, 012.37.6.2, 012.37.6.3, 012.37.6.4 , etc…..)

There are other solutions also. You can deny access to everybody by inserting this code


deny from all

I do not think this is a good idea, only if you have some really top secret files on the server. You can also deny by domain name instead of IP address.

 



Comments
Add New Search RSS
+/-
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
Please input the anti-spam code that you can read in the image.