Deny Visitors by IP Address Using .htaccess File
How to Deny Visitors by IP Address Using .htaccess File
Using .htaccess file you can deny or allow any visitor to access your website. This is extremely useful for blocking unwanted visitors, or to only allow the web site owner access to certain sections of the web site, such as an administration area.
order allow,deny deny from 255.0.0.0 deny from 22.214.171.124 allow from all
In above syntax we deny two IP 255.0.0.0 and 126.96.36.199 but remaining IP allow to access our website.
order allow,deny allow from 255.0.0.0 deny from all
In above syntax block all visitors except those with the IP address '255.0.0.0', which you should replace with your own IP address.