How to block/redirect hosts and subdomains of a host using htaccess?
- by Sven
I want to block several host-domains and their subdomains, as well as IP-Adresses using htaccess. So far I added to my .htaccess-file:
# block doamins and all subdomains
Deny from .example.org
# block domainrange: 1.2.3.[1-255]
Deny from 1.2.3.
# Block single IP
Deny from 2.3.4.5
but still I had problems with spam from e.g. server1.example.org. What is wrong with my script?
Is it also possible to redirect all requests from certain hosts/IPs to a document (say: info.html)?