Domain works with www, but not without

A few days ago I moved to a new server to host a website. I updated the nameservers and it seems to of pointed it correctly. Now if I type in www before the domain then the website comes up great. If I don’t type www and just do the http:// example dot com, it redirects back to the old server company and shows some ugly weird website that was not ours. Any idea on how to troubleshoot this issue.

Thanks in advance.

Sounds like the non-www version resolves to the IP of your old hoster, which in turn doesn’t recognize the domain and will show Apache default page (which in this case is the ugly website you’re talking about). You add the non-www version to the DNS.

Also take into account that DNS changes may take a while (up until a few days) to propagate properly, so it might be that you’ve set up everything properly, but the changes haven’t propagated yet so you can’t see them yet.

Also, check the DNS records on the new account and verify they have been setup to show the site without the “www” or that it points to the correct IP.

You have to set A-records propely at your registrar end.
Good luck.

This is probably up to the host to correct, and not in the OP’s capability via the registrar.

That can be done from within some hosting control panels depending on permissions.

You can simply redirect your page which is not opening with www, to open with www. I think this will solve the issue.

You can use 301 permanent redirection to solve this issue. Also check your A record, may be A record is not correctly added.

You should really setup your htaccess to direct all requests to www or or vice versa to avoid duplicate content problems.

If his records are not set up properly then an htaccess redirect will not occur.

Obviously the two A records need to match, could be that a dns flush is needed on the local computer.