how to Deny access to your site via htaccess full detail by jani

Tody i teach you

how to block visitors via .htaccess

If you have annoying visitors, site scrapers, or spammers, you may find it useful to block these users from accessing your website content. You can block bad visitors by IP address or blocks of IP addresses using a .htaccess file. Below are some useful examples: Requirements Before you start, be sure to have handy: *.Familiarity with the use of FTPand an FTP client. *.Plain text editor

Instructions

Secure directories by IP address and/or domain In the following example, all IP addresses and domains are accepted, except for xxx.xxx.xxx.xxx and example.com: # allow all except those indicated here 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]