How do I block visitors from my site?

Create a .htaccess file and add the following code--changing the IPs to suit your needs--each command on one line each:

order allow,deny 
deny from 
deny from 012.34.5. 
allow from all

You can deny access based upon IP address or an IP block. The above blocks access to the site from, and from any subdomain under the IP block 012.34.5. (,,, etc.)

You can also set an option for denying from all, which would, of course, deny everyone. You can also allow or deny by domain name rather than IP address (allow from works, etc.)

About us


We are a web development agency located in Cape Town, South Africa. We design great looking websites. We are CSS enthusiasts. We specialise in Content management systems. We are a professional Team with over 30 years of experience. Learn more.


facebook  linkedin  twitter  linkedin

Office South Africa

E: za [AT] raramuridesign [DOT] com
 +27 21 913 7872
Mon - Fri 09h00-16h30 (ZA)