XenForo Cloudflare Firewall Rule: Ban Country Codes from Registration

CR LEAKS

CR LEAKS

Administrative
Joined
Mar 25, 2022
Messages
1,272
Reaction score
5,191
Points
113
Credits
19,896
Quickly add a Cloudflare Firewall Rule to block registration from specified countries.

Go to Cloudflare > Firewall > Firewall Rules > Create a firewall rule
Look for small text link as you scroll down to Edit expression

Paste the following rule, making sure to edit the registration URLs to be correct for your installation.

The action is BLOCK but you may also choose to CHALLENGE.

Code:
Please, Log in or Register to view codes content!

Deploy

You can then go back to the rule and edit the countries if you want. Below are the countries included in the above code (including Tor).

The above rule is good for blocking a large number of countries but leaving most of the world open. Conversely, If your forum is only open to one (or a few) countries, simply change the rule to: Country is not in [choose country (or countries) to allow from dropdown].

Also, you may choose to make the URI Path more restrictive, ie. /forums/register/
 
4,485Threads
10,412Messages
39,631Members
mika67Latest member
Top