New Revised CSS Library Forums Web Tools
FAQs Awards Usage Terms Contact

.HTACCESS Banning Generator

Visitor IP Banning

The below form generates the appropriate .htaccess code to ban visitor(s) from your site based on their IP address. You can enter a partial IP address (see "Valid Entries" below) to catch all IP addresses that contain the partial IP within it. Separate each IP address with a line break, so each IP occupies its own line.

Enter User IPs to ban, each separated by a line break:

 

Examples of valid entries:

In general a valid IP should be in the format xxx.xxx.xxx.xxx, where "xxx" is a number between 0-255. You can enter a partial IP address to ban all IPs that contain this partial IP address within it (range of IPs).

  • 42.12.5.34 (Blocks a specific IP address)
  • 212.173.53. (Blocks ALL IPs within the range 212.173.53.xxx)
  • 69.242. (Blocks ALL IPs within the range 69.242.xxx.xxx)
  • 81.158.3 (Blocks ALL IPs within the range 81.158.3xx.xxx.xxx)

FYI, your IP is: 54.234.0.85

Be careful when banning entire ranges of IPs, as you may also be blocking legitimate traffic!

The syntax for a valid IP is in fact very broad and complex depending on your needs. Note that the above form currently only accomodates the basic syntax above. Please Email Us if you'd like a specific IP syntax to be supported (include example please).

Site Referrer Ban

The below form generates the appropriate .htaccess code to ban visits originating from certain domains. For example, if an undesirable domain is showing up a lot in your web site referrer logs, you can ban that domain so any traffic coming from it- human or otherwise- is blocked. Separate each domain with a line break, so each domain occupies its own line.

Enter list of domains to ban. Do NOT include the "http://www." portion!

 

Examples of valid entries:

  • badsite.com (Blocks traffic coming from badsite.com)
  • badsite. (Blocks traffic coming from all varieties of badsite.xxx, such as badsite.com, badsite.net etc)
  • subdomain.badsite.com(Blocks traffic coming from subdomain.badsite.com
  • 32.173.21.187 (Blocks traffic coming from a particular site IP)

Disable Hotlinking

The below form generates the appropriate .htaccess code to disable hot linking of common file types from other sites, so only your own domain(s) are allowed to reference/ access them. For example, by disabling hotlinking on .gif files, any site not within the allowed list of domains will get a broken image when they try to reference a .gif file that's on your server.

Enter a list of ALLOWED domains/ site IPs below that will be allowed to access the specified file types (see second text box) on this server. Then in the second text box, fill out the desired file types that are subject to "no hotlinking" by all domains thar aren't on the list of allowed domains.

Enter list of allowed domains/ site IPs. Do NOT include the "http://www." portion!:


Enter list of file types (its extension) that should be disallowed from hotlinking:

 

Examples of valid entries:

-For "Allowed Domains/ IPs"

  • dynamicdrive.com (Allow this domain to access the restricted file types)
  • tools.dynamicdrive.com (Allow this subdomain to access the restricted file types)
  • 24.56.32.125(Allows this site IP to access the restricted file types)

-For "List of File Types"

  • gif (Disallow hotlinking of .gif files on the server)
  • jpg (Disallow hotlinking of .jpg files on the server)
  • css (Disallow hotlinking of .css files on the server, so blank file is served instead)
  • js (Disallow hotlinking of .js files on the server, so blank file is served instead)

Deny browser access to generated .htaccess file. Not necessary unless .htaccess file is uploaded to a web accessible directory on your site AND server isn't configured to disable browser access to it (most servers are).