Forum Moderators: phranque
However, now when I type in the non-www version I just go straight to google which lists my www version straightaway or at other times I get a page saying 'site cannot be displayed'. So my non-www version seems to have vanished!
I tried adding a 301 redirect anyway but it doesn't make any difference?
Has anyone got any ideas - I'm completely stuck!
If this is the case, then it is a DNS problem, and not actually related to your server or hosting at all.
If absolutely nothing else has changed on your server, look into your DNS setup. You may be able to do this through your "control panel" in your hosting account. If not, then you'll need to use whatever tool your domain registrar has provided to open and edit your DNS zone file, to add or restore the DNS entry for your "www" subdomain (or for "wildcard" subdomains).
The DNS system is an independent network of servers that provides the function of translating domain names to IP addresses. Although we click on links with domain names in them, and type domain names into our browsers, the browsers themselves send our requests to servers using IP addresses. So if no DNS entry exists for translating "www.example.com" to the IP address of your server, then you'll get the "Cannot find www.example.com" message. And in the case where your ISP or your DNS settings cause DNS lookup failures to be forwarded to a page full of ads or to a search engine, then you'll see that page instead of the one you wanted.
Your post implies that "www.example.com" used to work, though. So as in most cases like this the questions are, "What settings have been changed recently?" and "Who's had their hands in it recently?" You may want to ask your host if they've changed anything recently as well.
Jim