开发者

htaccess deny all by ip address except those in united states?

开发者 https://www.devze.com 2023-03-28 14:51 出处:网络
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 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.开发者_Python百科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


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!

0

精彩评论

暂无评论...
验证码 换一张
取 消