{"id":2930,"date":"2019-10-23T17:18:06","date_gmt":"2019-10-23T09:18:06","guid":{"rendered":"https:\/\/www.mondoze.com\/guide\/?post_type=kb&p=2930"},"modified":"2022-10-05T08:00:32","modified_gmt":"2022-10-05T00:00:32","slug":"how-do-i-whitelist-cloudflares-ips-in-htaccess","status":"publish","type":"kb","link":"https:\/\/www.mondoze.com\/guide\/kb\/how-do-i-whitelist-cloudflares-ips-in-htaccess","title":{"rendered":"How do I whitelist Cloudflare’s IPs in .htaccess?"},"content":{"rendered":"\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t

How do I whitelist Cloudflare's IPs in .htaccess?<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t

You would put these commands in .htaccess to whitelist Cloudflare’s<\/a> IP addresses:\u00a0<\/p>

(IPv4)<\/p>

Allow from 173.245.48.0\/20
Allow from 103.21.244.0\/22
Allow from 103.22.200.0\/22
Allow from 103.31.4.0\/22
Allow from 141.101.64.0\/18
Allow from 108.162.192.0\/18
Allow from 190.93.240.0\/20
Allow from 188.114.96.0\/20
Allow from 197.234.240.0\/22
Allow from 198.41.128.0\/17
Allow from 162.158.0.0\/15
Allow from\u00a0104.16.0.0\/12
Allow from 172.64.0.0\/13<\/p>

(IPv6)<\/p>

Allow from 2400:cb00::\/32
Allow from 2405:8100::\/32
Allow from 2405:b500::\/32
Allow from 2606:4700::\/32
Allow from 2803:f800::\/32
Allow from 2c0f:f248::\/32
Allow from 2a06:98c0::\/29<\/p>

Please note: These ips should also be whitlelisted in \/etc\/csf\/csf.allow and \/etc\/csf\/csf.ignore.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"

How do I whitelist Cloudflare’s IPs in .htaccess? You would put these commands in .htaccess to whitelist Cloudflare’s IP addresses:\u00a0 (IPv4) Allow from 173.245.48.0\/20Allow from 103.21.244.0\/22Allow from 103.22.200.0\/22Allow from 103.31.4.0\/22Allow from 141.101.64.0\/18Allow from 108.162.192.0\/18Allow from 190.93.240.0\/20Allow from 188.114.96.0\/20Allow from 197.234.240.0\/22Allow from 198.41.128.0\/17Allow from 162.158.0.0\/15Allow from\u00a0104.16.0.0\/12Allow from 172.64.0.0\/13 (IPv6) Allow from 2400:cb00::\/32Allow from 2405:8100::\/32Allow from 2405:b500::\/32Allow …<\/p>\n

How do I whitelist Cloudflare’s IPs in .htaccess?<\/span> Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[53],"kbtag":[110],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/2930"}],"collection":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/comments?post=2930"}],"version-history":[{"count":7,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/2930\/revisions"}],"predecessor-version":[{"id":21929,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/2930\/revisions\/21929"}],"wp:attachment":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/media?parent=2930"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=2930"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kbtag?post=2930"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=2930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}