domain does not work without www prefix, but with it it does
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Thread: domain does not work without www prefix, but with it it does

  1. #1
    Join Date
    Jan 2008
    Posts
    43

    domain does not work without www prefix, but with it it does

    when i type paulgtremblay.com it does not work,
    but when i type www.paulgtremblay.com it does..

    What can be the problem?
    I use a php redirect on my site.

  2. #2
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: domain does not work without www prefix, but with it it does

    Both versions of the domain name (with and without the www. prefix) resolve to the same IP adress for me, so I presume that the web server software is only configured for the version with the www prefix and not for the version without.

  3. #3
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,840

    Re: domain does not work without www prefix, but with it it does

    The www is simply a sub domain. This is a complete DNS configuration. You can set example.com and www.example.com to point to two totally separate destinations, if you wanted. In order for them to point to the exact same thing, both need to be in your DNS zone file.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  4. #4
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,840

    Re: domain does not work without www prefix, but with it it does

    [ moved ]
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: domain does not work without www prefix, but with it it does

    @PeejAvery - Both domain names (with and without www) are already in the zone file and do resolve to the same IP address. This is why I presume it is more a web server configuration issue.

  6. #6
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: domain does not work without www prefix, but with it it does

    Where comes DNS to play in this scenario? I think that PeejAvery is right. I could hardly imagine your scenario.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

  7. #7
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: domain does not work without www prefix, but with it it does

    As I understood his post, PeejAvery and I speak about the same thing when we both mentioned DNS...

    Or are you referring to his [moved] post?

    Joking aside - you asked where DNS could come into play in this situation, which is a valid question. Let me explain.

    If you setup "www.something.com" to resolve into the IP address of your web server and you setup "something.com" to resolve into a completely different IP (like server only doing mail) then only the www.something.com address will show you the website and something.com will not. This situation would be purely a DNS issue.

    This morning, before I posted I checked the DNS setup for the domain name the OP mentioned in his post. Both versions resolve to the same IP address - so I concluded that this is NOT a DNS issue (as I wrote in my first post).

    I therefore stated that the most likely culprit is the web server being configured for only accepting GET requests for the www. version of the domain name. The site may be hosted on a shared host where multiple web sites are hosted on the same IP address. The server software used in this situation uses the domain name (quoted in the GET request of the HTTP protocol) to find out for which account the web request is meant. The domain name used in the GET request must match the name of the web account exactly, including any sub domain names.If not, then the request will be met by a 404 response.

  8. #8
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,840

    Re: domain does not work without www prefix, but with it it does

    We are on the same page, I just didn't clarify my post well enough.

    What I was trying to say...is that if a user can access www.paulgtremblay.com but not paulgtremblay.com, then the DNS zone file is not correctly set up. Plain and simple.

    EDIT: The DNS settings are not consistent.

    paulgtremblay.com points to 67.199.57.120.
    www.paultremblay.com points to 209.200.93.47.

    EDIT 2: Your smartest option is just to have the non-working one use a CNAME and point to the working URL. No need to have an A record (IP Address) as well.

    EDIT 3: For future record www.dnstools.com is a great DNS diagnostic.
    Last edited by PeejAvery; April 3rd, 2008 at 10:34 AM.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  9. #9
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: domain does not work without www prefix, but with it it does

    Thank you for your explanation - are you sure that this is still the issue when www.paulgtremblay.com and paulgtremblay.com both resolve into the same IP address?

    Edit: interesting - they both resolved to the same IP address early this morning... Or so I would have sworn! And, yes, they now resolve differently so it is a simple DNS issue. I reckon I must still have been asleep when I checked them...

    Thanks for clearing this one up! I hope that the OP also comes back to read this thread...
    Last edited by Edders; April 3rd, 2008 at 10:29 AM.

  10. #10
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,840

    Re: domain does not work without www prefix, but with it it does

    See my edit...
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  11. #11
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: domain does not work without www prefix, but with it it does

    LOL - please see my edit as well... Isn't it nice both posting and editing at the same time?

  12. #12
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: domain does not work without www prefix, but with it it does

    Actually - when I resolve them on a Virgin Media name server here in the UK both versions of the domain name use the 209* IP address... In a browser they both come up with the same "invalid hostname" error.

    When I try to resolve them on a BT name server they appear as you see them as well. But then in the browser one shows me Google and the other gives me the hostname error.

  13. #13
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,840

    Re: domain does not work without www prefix, but with it it does

    I see what's going on. Because they are changing all the time. As I mentioned in my 3rd edit, www.dnstools.com is my preference.

    These are not pointed to A records, nor CNAME, they both use NS (Name Server). This means they are redirected to those servers and then can be passed along because they are not static IP sites.

    @bulbish It still might be a DNS issue, but I would suggest contacting your ISP for further help. They could be a greater resource than we could ever be.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center