How to block any IP Address via dot htaccess rule?
To block unwanted visitors like bots or spammers, use your site’s (.hataccess )file on an Apache server.
For Apache 2.2 and below:
Order allow,deny
Deny from 123.123.123.123
Allow from all
For Apache 2.4 and above:
Require all granted
Require not ip 123.123.123.123
Replace the IP with the one you want to block. Add more lines to block multiple IPs.
This is a quick way to protect your site, but for stronger security, use a firewall or a service like Cloudflare. Always back up your (.hataccess ) before editing.