Tody i teach you
order allow,deny
allow from all
deny from xxx.xxx.xxx.xxx
deny from .*example\.com.*
In the following example, all IP addresses are denied access except for xxx.xxx.xxx.xxx and example.com:
# Deny access to everyone, except those listed here:
order deny,allow
deny from all
allow from xxx.xxx.xxx.xxx
allow from .*example\.com.*
This next example provides steps to block unwanted visitors based on the referring domain. Simply replace "baddomain01″ and "baddomain02″ with the offending domains of your choice:
# block visitors referred from indicated domains
RewriteEngine on
RewriteCond %{HTTP_REFERER} baddomain01\.com [NC,OR]
RewriteCond %{HTTP_REFERER} baddomain02\.com [NC]
RewriteRule .* - [F]