Cloudflare and htaccess Country Block Still Misses Some Traffic from Blocked Country


#1

SetEnvIf CF-IPCountry RU BuzzOff=1
Order allow,deny
Allow from all
Deny from env=BuzzOff

We are using above rules on our htaccess file. But I realize I still get some traffic from RU . Why it doesnt completely block that traffic?


#2

@fixingmywp You should use Cloudflare Access Rules

https://support.cloudflare.com/hc/en-us/articles/217074967-How-do-I-control-IP-access-to-my-site-


#3

How did you determine you still get some traffic from RU? Example?


#4

@cscharff

How did you determine you still get some traffic from RU? Example?

Because Google Analytics (and others) shows constant traffic comes from that country day by day.


#5

@hklcf
I already use that.


#6

It is entirely possible the Google Analytics and Cloudflare use different data sources to determine where an address is located and that there can be variance between the two. Assuming that the .htaccess rule is blocking based RU country code when it sees it, then the traffic coming in must be identified as a different country in the CF-Country value.


#7

I am experiencing a similar situation. I created a thread about this here (Access Rules - Javascript Challenge Bypassed) which may explain the results you are getting.

In my case, javascript challenge for certain countries is being bypassed as even though the bot ip is from a country which should be presented the challenge (via access rule) it is entering my site via a country where no challenge has been set (e.g., USA).


#8

This topic was automatically closed after 14 days. New replies are no longer allowed.