I am setting up a web site for a client. She is using GoDaddy for domain registration, and a hosting company I have never used before. After setting up the nameservers on GoDaddy's side, the address foobar.com (for example) is correctly directing to the new site. However, the address www.foobar.com is redirecting to a 404 page on the hosting company's side.

I've been dealing with customer service on the hosting side, and they have told me various things including wait for DNS propagation (which has obviously happened since the 404 page is on their side), and to make sure that the nameservers on GoDaddy's side were entered in lower case instead of upper case (which I know doesn't matter since nameservers are case insensitive).

I think I'm getting the runaround from the hosting company, but the client had signed up with them before I came to the project, so if possible I'd like to resolve this issue with them before we start treating it as a loss.

Does anybody know what could cause foobar.com to resolve correctly but www.foobar.com to not resolve? How would I best be able to suggest a fix to this through the technical support channels of a hosting company?

  • Have you set up a redirect for www.foobar.com to foobar.com? What sort of server is it? Apache? Jun 30, 2011 at 12:41
  • 1) DNS records are not live yet (but you are using GoDaddy .. and they are fast with this -- 10-20 seconds after you setup new A or CNAME record it all working). 2) Your local DNS cache (could be on your computer, or router or ISP) -- also quite unlikely to happen (but it may happen). Try rebooting. 3) Are you able to ping www.foobar.com? 4) Have you tried the same from another computer or portable device. 5) If you can -- please provide your domain name here so someone can check from another location
    – LazyOne
    Jun 30, 2011 at 12:48
  • @paul - After doing some digging, I'm guessing the hosting company is reselling space from Amazon's cloud. Jun 30, 2011 at 15:17
  • @LazyOne - I'd reveal the site name, but it's under an NDA and can't be made public yet, sorry. I've tried accessing from several locations, but none work correctly. Jun 30, 2011 at 15:19
  • Check their Control Panel -- maybe they (or you) have not setup domain alias or it is not pointed to the same folder (you need to make sure that your hosting package knows about both domain.com and www.domain.com and that they are pointing into the same folder). 404 page that you see could mean any of those scenarios.
    – LazyOne
    Jun 30, 2011 at 15:28

3 Answers 3


foobar.com is different than www.foobar.com . Generally most websites redirect "www" to foobar.com so it will be easier for users.

It is highly possible that you don't have such a redirect.

If your hosting plan supports this you can use an .htaccess (Apache web server) file to do that. If not you should contact hosting company to do this redirect for you.

  • I don't have access to the .htaccess file, but I'll ask the support to do that. Thanks. Jun 30, 2011 at 15:12

First check the DNS. By using the dig program (for example) verify that the IP addresses are the same for 'foobar.com' and 'www.foobar.com'.

If the addresses are OK, the next thing that may be wrong is virtual server configuration. Ask the hosting company how their webserver (Apache maybe?) handles the 'www' prefix.

  • They ping to the same IP address, but pinging www.foobar.com resolves to an amazonaws.com address. I'm guessing the hosting company is reselling Amazon AWS space. Jun 30, 2011 at 15:14
  • I was not talking about ping. How do you use ping to determine the IP address? I do not understand how it can "ping the same IP" and "resolves to [different one]". Could you show me the commands you type and the result you receive? If you are using Windows, then maybe they is a host command? Mentioned dig is the usual tool to determine IP addresses in Unixes.
    – Arsen7
    Jul 1, 2011 at 9:58
  • ...and if you wanted to say that the IP address is the same, but browser is redirected to amazon, then your problem is in virtual server configuration. Then, your solution would be to ask the hosting company. This is the same what Sinan suggests. But first, make sure the IP is really the same.
    – Arsen7
    Jul 1, 2011 at 10:06

I think in your case, you might be missing an entry in your DNS Zone.

CNAME (Alias)
Host Record            Points to
www                    foobar.com

This will point the "virtual subdomain" www to the root directory @ foobar.com/

Since the ages, everyone has pointed www to the same html root directory. In this case, the www is not seen as a valid directory html_dir/www and thus, returns the error.

After doing this, you can then place a .htaccess file to either drop the www or keep it around. Which is best is up to debate but I choose to drop it.

Now if you do not have accsees to change the DNS or want a quick and dirty hack:

Since the request actually looks for the .htaccess first, before replying a 404, you can actually also just write an .htaccess file to accept the request and display the content in your root directory as Sinan describes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.