I have a self-hosted and self-managed web server using Apache 2.4 on Debian. I use many domains on this server and have configured them using vhosts.
I want my users to use the domains I configured to connect with, instead accessing the server by its IP address. In other words, users currently can connect to my server using: http://XX.XXX.XX.XXX/my/web/page
and I want to block that from occurring. Instead I want them to use: https://example.com/my/web/page
.
How can I deny access to this webserver's pages when users try using its IP address for the URL?