This is old news, but because I've often needed to look for the exact syntax, I'm putting it up here.
To block an IP from your website, create a (text) file (if you don't already have one on your server) and name it ".htaccess". Put the following in that text file:
<Limit GET>
order allow,deny
allow from all
deny from 123.456.789.0
deny from 123.4.5.
</Limit>
replace the "123.456.789.0" with the IP you want to block. (you can have as many "deny from …" lines as you want) the "123.4.5." will block a range of IPs.
If you want to have a custom 403 page (the page that people get when they're blocked) put these lines below what you have above:
ErrorDocument 403 /403.htm
(the 403.htm is the page that you've designed… maybe you want to give them an email address to reach to request access…)
You can also have a custom 404 page (page not found). So add this in there too:
ErrorDocument 404 /404.htm
again, the 404.htm page is one that you've created.
Now upload the .htacess file to your server. Wherever you put it – it will effect the current directory, and all its subdirectories. Also, the FULL file name is .htaccess – no other suffix there…
UPDATED 3/18/04: I recently updated this post because of a problem I had. (Actually it was corrected sometime ago in the comments – but I didn't understand what they were talking about) In any case – I also wanted to add this: here's some more information on htaccess