Blocking IP addresses using your .htaccess file


You are able to block specific IP addresses by using your .htaccess file.

You can find your .htaccess file in your websites directory (usually httpdocs or public_html).If the files does not exist you can create a .htaccess file and add the following script replacing 168.1.1.1 with the IP address you are looking to block:

order allow,deny deny from 168.1.1.1 allow from all

Please then note that all users using that IP address will be unable to access your website.

You can also block county specific IP addresses, you can find a list of these IP addresses at https://www.countryipblocks.net/country_selection.php







Comments

Please login to comment