@shyann
To block unwanted hosts in .htaccess, you can use the following directives:
1 2 3 4 5 6 |
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_REFERER} example.com [NC,OR] RewriteCond %{REMOTE_ADDR} 192.168.1.1 RewriteRule .* - [F] </IfModule> |
Replace "example.com" with the hostname or domain name you want to block, and "192.168.1.1" with the IP address you want to block.
Now, any requests coming from the specified hostnames or IP addresses will be blocked and the server will return a 403 Forbidden error to them.