I have a website with CloudFlare protection, seems good at too, but if you enter the original IP adress of my server you can enter normally.
I’m using Apache (XAMPP) and SSL (https://)
I want something similar when you enter from the IP address with CloudFlare, which throws error 1003
3
Answers
You can verify if the domain received in the request matches your site domain. If not, force a redirection to the user. Like so:
So IP accesses will be forced back to the domain name.
Obviously, you could return anything, this is just one method I see often.
Edit or create a default vhost and put this inside:
xxx.xxx.xxx.xxx is your server ip address
After that restart your apache
Hope that helps
Under the ubuntu 20.04
Server version: Apache/2.4.41 (Ubuntu)
i just copied my 000-default-ssl.conf as disable-ip.ssl.conf and put below the content
content of disable-ip.ssl.conf vhost file
then