I would like to disable access to my server via IP. So if someone tries to access my server by its IP, they should be blocked (or rerouted to the URL.)
What I am trying to achieve is block all of the attacks that use my IP instead of an URL. No legit visitor does that and it allows attackers to avoid Cloudflare and any blocking rules.
I found this on the web but it doesn't look right, or does it?
ServerName 188.8.131.52 Redirect 403 / ErrorDocument 403 "No" DocumentRoot /dev/null/