I have a website that can be loaded by visiting either the domain name or IP address. The domain name version is secure, while the IP address version is not. I can load all the same pages by visiting the IP address. I want the IP address version to resolve to the domain name. I have an A record which specifies domain name and correct IP address.
What do I need to do to redirect the IP address to the domain URL?