How to block only one visitor(by his IP) via .htaccess file? [Important| Revised 2019]
If you want to deny a single visitor to access your site or you don’t want that visitor to view your site then you can block that visitor by using his IP address.
Here is a code you can write in your .htaccess file to block user from his IP address: [Updated May 2019]
deny from IP Address
For example you can write “deny from 18.104.22.168“
Just for testing purpose here in my htaccess i am denying a visitor whose IP is 22.214.171.124 . See the screenshot below-
Now this code will disallow that IP to access my site, hence it will generate 403 Forbidden error as you can see in the below screenshot
Hope this helps you:-)
Thanks for Reading!!!!
Tags: cheap linux hosting, buy linux hosting, cheap reseller hosting, buy reseller hosting, best reseller hosting, cheap web hosting, cheapest web hosting, cheapest reseller hosting, cheap reseller host, cheap linux host, cheapest linux hosting, best linux hosting, best web hosting