.htaccess GeoIP Country Blocking Generator

Select the countries you want to block and generate ready-to-use .htaccess code — line by line, for both IPv4 and IPv6.

📊 View usage statistics

1. What do you want to do with the selected countries?

2. Which server does your site run on?

Not sure? Ask your hosting provider, or check cPanel under "Server Information" — it often lists "Apache" or "LiteSpeed Web Server". Apache uses SetEnvIf combined with Deny from env (via mod_access_compat), so existing vhost-level rules such as basic authentication stay intact.

3. Select countries 0 selected