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
184.108.40.206 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
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.