HTTPS shows my correct domain, HTTP shows the IP of my webserver

February 20, 2019 276 views
LAMP Stack Apache WordPress PHP Ubuntu 18.04

Hi All,

I have followed this tutorial to install LAMP, secure with SSL and install wordpress. And have completed all the prerequisites.

I have it all set up on the basic webserver that digital ocean offers.

I have set up all my domains and virtual hosts.

I've set the url in the wordpress settings.

However when i go to the http://example.com it shows the ip of my web server. When i go to https://example.com, it shows the correct url.

Im not sure what setting i need to change so that the url for http is example.com ?

Any ideas?

2 Answers

I managed to "fix" this.

Google chrome had cached the website as my IP address.... I opened up chrome in incognito mode and it started to come up as my URL.

So it was working all along.

DAMN YOU CHROME!

Hey friend,

Great question! What this means is that traffic over port 80 is being redirected to the site IP specifically. If you haven't configured this in your web server configuration, then it is being done by the web application which is listening at that location.

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 the steps 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:

https://codex.wordpress.org/Changing_The_Site_URL

Jarland

Have another answer? Share your knowledge.