How to Stop Certain Countries from Visiting Your Website

Adding IP rules to your .htaccess file lets you limit who can see your website based on where they are from. This helps keep unwanted traffic, spam, and malicious access to a minimum.

Step 1: Make the Country IP Rules (ACL)

Step 2: Copy the ACL Rules

The ACL will look something like this:

Deny from 1.0.0.0/8
Deny from 2.16.0.0/13

Step 3: Put ACL in Your .htaccess File

Important Things to Remember

Need Help?

If you don't know which option to choose or need help changing your .htaccess file, get in touch with the Cyberin support team.