MYSYSAD.COM

Use .htaccess to Deny Internet Protocol (IP) Address or Domain Name

· Networking & mail

You can use the .htaccess file to deny sites that are wreaking havoc on your site. I have a dozen or so IPs from a couple countries that are doing just that to one of my sites. You can block specific IPs/IP blocks or deny by domain names.

The first two lines (deny statements) are indicative of what I did. By the way, I don't control the main configuration of the host (server), so I had to use this file.

# vi .htaccess
order allow,deny
allow from all

deny from xxx.xxx.xx.xxx
deny from xxx.xxx.xxx.xxx
deny from xx.xxx.xx.
deny from xxx.xx.
deny from xx.
:wq!

Here's a screenshot (so tags shows up on this Blogger post) with the tags:



Extra:
If you are trying to block IPs on the Blogger.com platform, see this post: How to block IPs on Blogger.com