How to set URL to appear as domain and not IP?

Having followed all the necessary steps to set up my domain in Digital Ocean, the domain name now points to the IP address as it should. However, my IP address is the one visible in the URL, not the domain. I understand this is a common issue with WordPress, but I am not using WordPress. I have uploaded all my files via FTP.

I have attempted changing configurations in sites-available, sites-enabled and other default configurations, still to no luck. I have been using port 443 for the website.

How could I solve this? Thanks in advance.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Ok, so I still have not managed to figure this out and I have discovered another issue. The website seems to work fine for people in my Wi-Fi network, but does not work on any other networks. I have looked online and cannot figure out any reason why this might be the case. See for yourself: or

It works for me on all devices and all other in the same network - but no one from outside it. To people outside the network it shows the plain index.html file, but does not use any other files.

Let me try this again and see if I can do better :)

So here is what I gather to be the relevant variables:

  1. Not Wordpress (learn to read, Jarland)
  2. Virtual host is configured with ServerName to match the domain (implied at least)
  3. Calls to the domain redirect to the IP in the URL bar

So we know a redirect is happening. You did say it isn’t Wordpress but didn’t say that it is a static site, so I’m coming up with two possibilities:

  • Web server configured to redirect elsewhere. Check for any .htaccess, might as well do a full search for good measure:
find / -name ".htaccess"

If that is all clear, I’m going with:

  • It is another web application which is dynamic in nature, and may be hard coded to either use the IP as the URL or to pull it from the system. So you’d need to hunt for any code that could perform a redirect and then find out how it’s pulling the value that it redirects to. That’s pretty vague because it could literally be anything from my perspective at that point.


Hey friend,

Every time I’ve heard this story it has been about Wordpress, so forgive me if I make an incorrect assumption. However, if I assume correctly that it is, you would need to follow one of the methods here to make sure that Wordpress does not have your droplet IP listed as the site address in any of the places that it stores it: