We help IT Professionals succeed at work.

url with www and without www gives diff pages

mchopda
mchopda asked
on
Hi
This is another strange problem i am facing.  we shifted the hosting provider of a website. It gives the correct page if i type http://www.devrajcomputers.com  but if i give http://devrajcomputers.com it gives me the old page.

What is this problem ?
Not able to understand.  How do i make sure that when a person enters both the with and without 'www' it shows the current web page only.

Please advise

Thanks
Mahesh
Comment
Watch Question

Commented:
I get the same page ("under construction") for both.

It could be a caching issue your end.

Ant

Commented:
most browsers not all.. will prefill both http:// and www portion.. (defaulted) so when you type in yoursite.com it is essentially converted to www.yoursite.com

CJ

Commented:
Cheekycj is incorrect in his comment.  This change is caused by a combination of DNS and the webserver.  Specifically, when you enter devrajcomputers.com, your computer talks to the local DNS server which in turn queries ns.ocpdns.com.  This is your primary DNS server for your domain.  It returns:

     Name:     devrajcomputers.com
     Address: 64.14.119.231

When you browser actually connects, your webserver recognizes itself as www.devrajcomputers.com and returns that to the browser, thus the "conversion" Cheekycj mentions.

Your primary DNS server, ns.ocpdns.com returns the same information for www.devrajcomputers.com:
     Name:     www.devrajcomputers.com
     Address: 64.14.119.231
Therefore, as a.marsh mentions above, this is most likely a caching issue at your end.



Commented:
As a followup, I, too, see the same "construction" page mentioned by a.marsh.  If, there is in fact differences between the pages, your new ISP might have set up the virtual host entries differently for devrajcomputers.com as compared to www.devrajcomputers.com.

Commented:
I know some browsers prepended the http:// but some don't.

True that DNS resolution occurs at the Internic's DNS Server but what is resolved is in reverse order starting with the last part.. first .com is resolved and sent to the appropriate name server.  Then the devrajcomputers part is resloved to find the specific ISPs DNS Servers IP address.  The request is then sent to the corresponding ISPs DNS Server that resolves the www or any other subdomain and sends the request to the appropriate server in their server pool.  

  The webserver doesn't really have anything to do with recognizing the URL or the domain name.  The web server should and does just serve HTML or whatever data to the user agent and deal with SUB domains and/or VIRTUAL domains.  All resolutions are done before they get to the webserver level.  The Webserver may then have virtual domains setup which may point to the different directories.

I took for granted that most ISPs congifure yousite.com and www.yoursite.com to point to the same webserver.  I apologize.  Its usually something that doesn't need to be requested.  My terminology was wrong about the browser doing the prepending.. its more of a resolution.  Once the resolution occurs.. it is cached.

CJ
CERTIFIED EXPERT

Commented:
You'll also get the same result if the site's primary server's host file says to point to one location for devrajcomputers.com and says to point to a different location for www.devrajcomputers.com. One of the geniuses in our IT department forgot about that a few weeks ago... *shaking head*...

Author

Commented:
I have cleared the cache in our local server and the proxy server cache n no of times.  We have also rebooted after clearing the cache and it still shows me the different pages.  I have even contacted the hosting provider and he too says that he sees both pointing to the under construction page.

Is it something to do with my ISP.  are pages being cached here or something.  but if that is the case then it should not show me other sites where i regularly change content.

Could you please tell how to have this problem solved.  do i have to ask the hosting provider to do something to get rid of this problem.

Mahesh

Author

Commented:
Also when i say devrajcomputers.com/index.asp it shows me the correct page.  but when i type only devrajcomputers.com it goes to the old web site. I thought probably this would be additional information which could help.

Mahesh

Author

Commented:
Also when i say devrajcomputers.com/index.asp it shows me the correct page.  but when i type only devrajcomputers.com it goes to the old web site. I thought probably this would be additional information which could help.

Mahesh

Author

Commented:
Also when i say devrajcomputers.com/index.asp it shows me the correct page.  but when i type only devrajcomputers.com it goes to the old web site. I thought probably this would be additional information which could help.

Mahesh

Commented:
is the old page like index.htm still there.. maybe it the order of your default pages is index.htm, index.asp so if index.htm (the old page) exists it will be served first.

CJ

Explore More ContentExplore courses, solutions, and other research materials related to this topic.