Block IP Address - Blocking a Visitor from Site

Block IP Address: How do I block a visitor from viewing my Site? Blocking certain IP addresses from viewing your Website is one way to keep a person or group of people from viewing or accessing your Web Pages. IP blocking will restrict who can view your site.

Your IP Has Been Temporarily Blocked

Your IP has been Temporarily Blocked
your ip has been temporarily blocked

Keep in mind that it is possible to end up unintentionally blocking a group of people outside of your target group. Therefore IP blocking should generally be avoided, if at all possible. For those who still want to proceed, the following tutorial explains how to block an IP address using your .htaccess file.

How To block IP Address using .htaccess

  1. Download Crimson Editor (Notepad++ or use your own favorite text editor).
  2. Using the text editor, open your current .htaccess file if you already have one or create a new file named .htaccess.
  3. Add the following code to your .htaccess file:
    order allow,deny
    deny from 100.200.300.4
    allow from all
  4. Replace 100.200.300.4 with the IP address you would like to block.
  5. Save the file and upload it via ftp to your server

Blocking Multiple IP Addresses

You can easily add more blocked IP addresses. For each address just replicate the "deny from 100.200.300.4" line. Replacing the numbers with the IP you wish to block.

order allow,deny
deny from 100.200.300.4
deny from 200.300.400.5
deny from 300.400.500.6
allow from all

Blocking a range of IP Addresses

If you want to block a complete range of IP addresses, simply drop the last octet from the IP address. Here's an example:

order allow,deny
deny from 100.200.300.
allow from all

This would block the range of IP addresses in the 100.200.300.XXX block. X representing any number or numbers.