Blocking access by IP

What is the preferred method of blocking access to a site based on IP?



I do that using the .htaccess file., like this:

order allow,deny
deny from
deny from 192.168.2.
allow from all


maybe i understand wrongly. but by using htaccess file should be the best way to achieve it because it blocks access before server loads the page.

Save [color=#CC0000]$97[/color] (max discount) on dreamhost plans by using promo code: [color=#CC0000]97CRAZY[/color].