Blocking Certain IPs

Are there stalkers annoying constantly trying to spam you? Is there someone in particular that you want to keep your site visible from? If so, you can use a simple .htaccess file to block them from your site.

Step 1: Create a .htaccess file. For those of you who don't know what that is, it's a file named .htaccess that can be used to affect the directory it is placed in, as well as all sub-directories. (And yes, just to clear this up there's no something.htaccess. It's just .htaccess.)

Step 2: Copy and paste this code into your file, one command on each line.
order allow,deny
deny from 123.456.789.012
deny from 345.678.901.*
allow from all


This example blocks the single IP 123.456.789.012, and on the next line it blocks the range of IP's beginning with 345.678.901. In other words, it blocks 345.678.901.1, 345.678.901.2, 345.678.901.3, . . .

Replace the IP's in the code with your own IP's you wish to ban.

Step 3: That's all! Save your .htaccess file and upload it to your server. And you've banned those nasty spammers! >:P

You can also deny (ban) from domain names -
deny from .google.com
works for www.google.com or images.google.com. Enjoy! =)


[Back]


Custom Search


Choose Your Skin:

Site
 
Designs
 
Graphics
 
Scripts/Reads
 
Tutorials
 
Affiliates
 
Other
 
Skins
 
eXTReMe Tracker