I have a local Web site that I would like to tighten access to only those within the United States; or perhaps only within Florida. It's a Word Press site that has gotten hacked due to some weak code. I've seen two sources of IP address lists for .htaccess "allow deny" control by IP Address.
IP by Country/Continents: http://www.countryipblocks.net/continents/
Wizcrafts List: http://www.wizcrafts.net/htaccess-blocklists.html
What is the best approach for blocking everything except United States traffic? How would you approach the deny/allow? Would you deny other Countries or try to allow only the U.S.?
Thanks for any comments, Jeff
htaccess or you want to create settings for a list of addresses, all you need to do is: Create . htaccess file in your public_html folder. Add lines based on your preferences.
htaccess to make it happen. For example, deny from all is a command that will allow you to apply access restrictions to your site.
htaccess IP deny access. To deny access to a block of IP addresses, simply omit the last octet from the IP address: deny from 123.456. 789.
Add this list to the .htaccess located on the root folder of your server.
It will only allow connections from the US.
ex .htaccess file:
allow from IP
203.31.234.0/24
129.230.176.0/20
etc...
you can use deny from All
in order to forbid access to your site!
In countryipblocks you can download all IPs from the area you want and add allow from IP
to your .htaccess file! so only those IPs can access to your site!
Edit: Remember you can add IP range instead of one IP! I downloaded .htacees from that site, and that was ok!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With