Search code examples
dnsno-www

Website requires www. prefix?


This isn't really code related, but at the same time it seems like the right place to ask. It's not happened to me for a while but a friend mentioned it in conversation earlier and now I need to know because it's bugging me!!

There are certain websites that require you to put in a www. prefix to actually visit their site. so as an example if I typed in domain.com the page wouldn't be found, but www.domain.com works perfectly fine. I can't think of any real examples which is frustrating me, but it happens every so often! I also see www1.domain.com occasionally... Not sure what that means either!

Could anybody explain these to me as I cant make any sense of it!

Thanks!!


Solution

  • This is because the dns or host files are configured that way.

    If you configure the dns to only respond to www it will ignore all other requests for your domain. If you configure the host files without a "catch all" you will have the same behavior.

    I usually use a global dns record to redirect all requests without a specified domain prefix to a default server. And on my servers I usually have a "catch all" rule to redirect unfamiliar requests to the root of the main website.