Question

Domain redirects to IP address and also loading from IP address

  • Posted October 23, 2013

Hi, I have a droplet running the latest ubuntu and wordpress. I set up everything like in the tutorials and my domain is working. But when I type in www.mydomain.com/wp-admin, it redirects itself to xx.xxx.123.456/wp-admin which is the IP address of the droplet that DigitalOcean gave me. Also, when I go to www.mydomain.com, my homepage loads just fine but I notice my browser says that its is connecting and waiting for xx.xxx.123.456, not www.mydomain.com itself. I may be unclear here so please ask for more info. I would not like to expose my IP address like that and also it looks extremely shady to my visitors. Please help! Thanks a lot!

Subscribe
Share

same issue. any resolution?


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

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.

Log into your WordPress Dashboard & navigate to Settings. What’s listed as your <code>Site URL</code> & <code>Home URL</code>?

Did you configure wordpress with your IP address before purchasing or setting up your domain name? I do know that Wordpress uses a lot of absolute links which I believe is the source of your problem.

hi Pablo,when i follow your instractons then the site is broken redirect my site to a broken site also wo-admin url not working! <br>“Log into your WordPress Dashboard & navigate to Settings. What’s listed as your Site URL & Home URL?”

Wow I’m such an idiot. The URL in WP is… the IP address. I didn’t think to check for that first. <br>Thank you a lot Pablo! I am this close to create another droplet and start over lol! Please know that I’m deeply grateful!

@Pablo of vDevices: I followed the tutorials and add all the info like you said but the problem is still there. :(

Execute <code>cat /etc/apache2/sites-enabled/000-dafault</code>. Do you see a line that begins with <code>ServerName</code>? If so, what’s after it? If not, then add it, as described in <b>Step Five</b> of: <a href=“https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts”>How To Set Up Apache Virtual Hosts on Ubuntu 12.04 LTS</a>.

@Ahrotahntee: Yes, I managed to install WP using the IP address and then later I pointed my domain to that IP. How should I fix this? <br>@Pablo of vDevices: In /etc/apache2/sites-enabled, only the 000-dafault file is there. Please advise! <br>Thanks guys for your help!

Look in <code>/etc/apache2/sites-enabled</code>. Then, execute <code>cat [filename_of_your_wordpress_config_file]</code> and look for the <code>ServerName</code> directive. What do you have listed?