I'm a web developer on a software house, which develops websites for clients. The websites are hosted by third party, so we don't have full control over it.

One of our clients one day asks us, why they can access their website if they write to the address, say: `www.example.com/`, but they can't connect if the address is, say: `example.com/` ? They need that the website can be accessed normally with or without the www. When accessed without the www, it's not returning 404 server not found. The browser **can** find the server of the website, but instead returning the website's own 404 resource not found error page. That means the url without www is pointing to a nonexistent resource **within** the website, but the website itself is found. I still can't understand why `www.example.com/` point to different resources than `example.com/`. I still don't know where the `example.com/` points to.

The server is using apache-tomcat, and the web pages are served using servlet and Enfinity framework.

I initially suspect this has something to do with DNS. But now I'm not sure so much. Can you point me to the direction of which may go wrong? Thank you very much.

Note: I don't know if this question is appropriate to be posted on the Server Fault. If it's off topic, please kindly transfer it to appropriate forum.