Does htaccess reject everything by ip address except those listed in the United States?

I have a local website that I would like to expand access only to those located in the United States; or perhaps only in Florida. This is a Word Press site that has been hacked due to weak code. I saw two sources of IP address lists for managing .htaccess "allow deny" by IP address.

IP by country / continent: http://www.countryipblocks.net/continents/

Wizcrafts List: http://www.wizcrafts.net/htaccess-blocklists.html

What is the best approach to block everything except United States traffic? How do you approach deny / allow? Would you refuse other countries or try to allow only the US?

Thanks for any comments, Jeff

+4
source share
2 answers

Add this list to the .htaccess located in the root folder of your server.
He will use only connections from the USA.

ex.htaccess file:

allow IP address 203.31.234.0/24
129.230.176.0/20
etc...

+4
source

you can use deny from All to deny access to your site!

In countryipblocks, you can download all the IP addresses from the area you want and add allow from IP to your .htaccess file! therefore, only those IP addresses can access your site!

Edit : remember that you can add an IP range instead of a single IP address! I downloaded .htacees from this site and it was ok!

+2
source

All Articles