L
L
linuxoid_inrus2020-10-16 19:48:00
Apache HTTP Server
linuxoid_inrus, 2020-10-16 19:48:00

How to block Direct IP 443 ports in Apache?

How to edit .htaccess so that it does not allow the machine to enter the site by ip?

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/12
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 199.27.128.0/21
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


It works, but for some reason it only blocks port 80 (allow for Cloud IP)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lesha, 2020-10-16
@linuxoid_inrus

RewriteCond %{SERVER_PORT} 443
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R,L]
?
Should work, because you have a Cloudflare range in the list, and he refers to 80

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question