I need to figure out how to block direct IP access to my website.
Example: I want it so that when people type my IP address 1.2.3.4
into the browser it doesn't work, but when they type www.example.com
it does work.
I am using Apache 2.4.9
, and my website is run using WampServer
.
I have tried other solutions from some old questions on here, but none of them have worked for me. I have tried pasting virtual host stuff into the vhosts.conf, but I couldn't get it right, and I tried doing rewrite stuff with the htaccess file, but that didn't work either.