How to redirect IP to Domain

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?

Your visitors should only remember the domain name and visit it by the domain name.

If so, the DNS should be proxied :orange: then.

If it’s Apache web server, maybe the article from below could help you in such case:

2 Likes

DNS is already proxied.