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 126.96.36.199“
Just for testing purpose here in my htaccess i am denying a visitor whose IP is 188.8.131.52 . 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