Why Block Countries

Use case: Reduce spam, attacks, or bandwidth from specific regions.

Using ConfigServer Firewall (CSF)

WHM → Plugins → ConfigServer Security & Firewall → Firewall Configuration → Country Code Lists.

Enable CC_DENY

Add country codes (e.g., CN, RU) separated by commas.

Alternative .htaccess Method

GeoIP Blocking Code

SetEnvIf GEOIP_COUNTRY_CODE CN BlockCountry
SetEnvIf GEOIP_COUNTRY_CODE RU BlockCountry
Deny from env=BlockCountry

Common Blocked Countries Table

CodeCountryTypical Reason
CNChinaHigh spam/attacks
RURussiaBot traffic
UAUkraineMixed traffic
INIndiaScraping