# Block an ip range but allow one ip from that range



## Touma (Oct 12, 2005)

Is it possible to block an ip range and allow one single ip to access a site using .htaccess?

I know the script for denying an ip range let's say 203.218.xx.xxx is



> <Files 403.shtml>
> order allow,deny
> allow from all
> </Files>
> ...


(I copy from my Cpanel file manager)


If I wish to allow an ip add 203.218.22.777 access, how do I go about it?

Thanks!


----------



## Uranium-235 (Aug 29, 2002)

after deny, put this

allow from 203.218.22.777

logical, no?


----------



## Chevy (Jul 25, 2003)

It depends ... If it works like ACL's on a router, then once a packet meets a condition, no other checks are made.

Can you do partial ranges, ie:

deny from 203.218.0.0-203.218.22.76
deny from 203.218.22.78-203.218.255.255
allow from 203.218.22.77


----------

