General Networking/Lan/Wan/Question about DNS (or maybe not)
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/".
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.
It most certainly sounds like it is very likely a DNS configuration issue. It could also be a problem with the configuration of the virtual hosts file in Apache, but that is only usually the case if multiple web sites with different domain names are running on one server.
Technically www.example.com and example.com are two different things according to DNS, so it is not automatically the same thing, it has to be set up that way. The www. is what is called an "A" record in DNS, and it is probably pointing to the wrong IP.
To verify it is DNS, you can use the nslookup command in the command prompt of windows (I'm not sure the Linux equivalent). It would be written as "nslookup example.com" and "nslookup www.example.com" which will tell you the IP address it will resolve to. You can also use www.mxtoolbox.com to look up the A record.
If it is a virtualhosts problem, I haven't done that in quite some time as I've focused more on Microsoft products, but this may help you to start out - http://httpd.apache.org/docs/2.2/vhosts/examples.html
Since it is hosted elsewhere, it is very likely the provider would need to do this for you if they haven't already.
Let me know if you have any other questions or if anything didn't make sense in my answer.