These .htaccess
rules work:
<RequireAll>
Require all granted
Require not ip 1.22.333.444
.
.
.
</RequireAll>
These .htaccess
rules don't work:
<RequireAll>
Require all granted
.
.
.
Require not host bad_host
</RequireAll>
These .htaccess
rules don't work as well:
<IfModule mod_rewrite.c>
RewriteCond %{REMOTE_HOST} (163data|amazonaws|colocrossing|poneytel) [NC]
RewriteRule .* - [F,L]
</IfModule>
I wrote into the .htaccess
file at the top:
HostnameLookups On
The result was an error message, because this command is not allowed in .htaccess
. So I removed this statement.
In Apache, there is a "remote_host" corresponds to a certain IP. I want tp prevent unwanted hosts to visit my site, such as spammers or such which generate much useless traffic in my site.
What is wrong in the code example above?