- Joined
- Jul 25, 2024
- Messages
- 142
- Thread Author
- #1
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.
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/
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.
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/