About IP Ranges cloudflare

I put this code in the .htaccess file to prevent any other ip from entering my site am I wrong or is this ok or what thank you

order deny,allow
deny from all
allow from 103.21.244.0/22
allow from 103.22.200.0/22
allow from 103.31.4.0/22
allow from 104.16.0.0/13
allow from 104.24.0.0/14
allow from 108.162.192.0/18
allow from 131.0.72.0/22
allow from 141.101.64.0/18
allow from 162.158.0.0/15
allow from 172.64.0.0/13
allow from 173.245.48.0/20
allow from 188.114.96.0/20
allow from 190.93.240.0/20
allow from 197.234.240.0/22
allow from 198.41.128.0/17
allow from 2400:cb00::/32
allow from 2606:4700::/32
allow from 2803:f800::/32
allow from 2405:b500::/32
allow from 2405:8100::/32
allow from 2a06:98c0::/29
allow from 2c0f:f248::/32

You can find the current ranges of Cloudflare’s at this link. At first glance your list looks good.

2 Likes
  1. If your server restores visitor IP addresses, then your site will break. But I suppose your server doesn’t do this, so you’re going to use this method.
  2. I do believe your order is backwards. I could be wrong. Your deny statements take priority, and you set Deny to All. It should probably be: order allow, deny
4 Likes

It would be best if you used IP tables to achieve better performance.

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.