HTML Basix - HTML tutorials and online webmaster tools

Htaccess code generators Code generators Tutorials

Subscribe to RSS feed
Subscribe to the HTML Basix RSS feed.
Square - receive up to $1000 in payments without any fees - after that, a low 1.9% fee is applied.

Htaccess Block Users Code Generator

You can use htaccess to block certain ip addresses from accessing your site. This might be one particular person who's giving you grief, or an ip range from a certain country you'd prefer not to access your site. You can use a full ip address, or only a partial ip. If you put in '' this will block only users with that exact ip address. Keep in mind that users who run through a proxy server will have a different ip number each time they connect, so you might want to use, for example, '203.156.187'. This will block all users with the ip address of -

Remember - this might 'lock out' legitimate visitors to your site, so use the ip block cautiously.

  • Enter the ip address or partial ip address you'd like to block from your site.
  • You can also use domain names, ie will block all users from aol.
  • Hit generate.
  • Copy the generated code and paste it into notepad and save it as htaccess.txt. Upload it in ASCII format to the main folder of your website, or the folder you'd like to block access to. Rename it to .htaccess (remember the dot!!)
  • Unless you have your ftp program set to show invisible files, the file will then disappear from sight. Don't worry, it's still there!
  • If you have an existing htaccess file, copy and paste the generated code into that.
  • Hit enter after the last line of code, or it may produce an error

ip numbers/domain names to deny access from
ip/domain 1:
ip/domain 2:
ip/domain 3:
ip/domain 4:
ip/domain 4:
ip/domain 6:
ip/domain 7:
ip/domain 8:
all server configs are different - if this code doesn't work, check this box and generate again


Page will open in a new window

Site Stats     
Total: 9,779,109 Total: 28,358,077
Today: 214 Today: 501
Yesterday: 360 Yesterday: 854
Past Month: 11,160 Past Month: 26,474

341 visitors in the last 24 hours
This page has been visited 211,477 times
There is currently 1 visitor online
click to see where
most people online at once:
286 visitors on 06/27/2012
   You beaut

This site is © HTML Basix 2003 - 2009