htaccess allow / deny IP address

Deny all Allow from IP

Apache 2.4

<RequireAll>
	Require ip xxx.xxx.xxx.xxx
</RequireAll>


Apache 2.2

<Limit GET POST>
order deny,allow
deny from all
# YOUR OWN IP ADRESSES
Allow from xxx.xxx.xxx.xxx
</Limit>

Allow all Deny from IP / host

Apache 2.4

<RequireAll>
    Require all granted
    # DENY BAD IP ADRESSES
    Require not ip xxx.xxx.xxx.xxx
    Require not host badsite.com
</RequireAll>

Apache 2.2

Order Allow,Deny
Allow from all
# DENY BAD IP ADRESSES
Deny from xxx.xxx.xxx.xxx
Deny from badsite.com

Deny access to file

Apache 2.4

<Files ~ "readme\.txt">
    <RequireAll>
        Require all granted
        Require not ip xxx.xxx.xxx.xxx
    </RequireAll>
</Files>


Apache 2.2

<Files ~ "readme\.txt">
	Order Allow,Deny
	Allow from all
	Deny from xxx.xxx.xxx.xxx
</Files>

Deny all

Apache 2.4

Require all denied


Apache 2.2

Order deny,allow
Deny from all

Allow all

Apache 2.4

Require all granted


Apache 2.2

Order allow,deny
Allow from all

Links:
Apache 2.4 Access Control
Apache 2.2 Module mod_authz_host