How to Block IP by Country: Restrict Access to Your Website from Specific Countries Using .htaccess

https://www.ip2location.com/free/visitor-blocker

  1. Head to the IP2Location Firewall IP list tool.
  2. Select the country you want to block or allow.
  3. Choose between IPv4 and IPv6 in the IP Version menu.
  4. Choose the format in the Output Format menu. The choice depends on whether you want to block or allow visitors from those countries.
  5. Click Download.