vshotarov
By:
vshotarov

"Server not found" only when using wordpress after changing hosting of the domain

February 1, 2016 2.7k views
DNS WordPress Apache

Hi!

I've just recently set up an account at digitalocean and I love it so far! I moved my websites to the server and everything works great when i access them with the ip and using aliases in 000-default, but yesterday I changed the domain name servers to digitalocean and created a domain here and my website is no longer working.

I know it takes between 24 and 72 hours to propagate all the DNS servers, but what is really weird is that if I just create a plain index.php file with just

<?php
echo "Hi";
?>

it works. As soon as I switch back to my wordpress index.php and it gives me server not found. I tested it even through google pagespeed insights tool, and it is the same. When i use the simple "Hi" file it loads, when I use the wp file google gives me a DNS error.

Any help is much appreciated. Any suggestions?

Cheers
Vasil

2 comments
  • In a login console, use the command

    tail -f /var/log/apache2/error.log /var/log/apache2/access.log
    ## press the return key a few times to mark where your output is
    ## then use your browser to access that index.php file.
    

    Look for any "GET"s that fail and examine the URLs for anything unusual. (Press control-c to kill the tail command)

  • Thanks a lot for that. I didn't have to do it, as I just found out the problem. I will share it in the answers section.

1 Answer

It sounds to me like the domain is resolving but the settings in WordPress are not matching up with the newly configured domain. If you can access the wp-admin control panel via the IP address, try adjusting the siteURL fields on the settings page to ensure they match up with the new name.

Based on your description it sounds like WordPress is attempting to redirect connections to a URL that is no longer good.

  • That makes total sense, but the thing is that the domain is the same, I've just pointed it to the digitalocean server. So, the settings in wp-admin are the correct ones.

    • It was a really silly issue. I changed the siteurl from www.mydomainname.com to mydomainname.com and it worked. Thanks a lot for the answers! It's great to know that there is such a quick to respond community behind DO's back.

Have another answer? Share your knowledge.