The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

www not working

Discussion in 'General Discussion' started by Voltio, Aug 31, 2010.

  1. Voltio

    Voltio Active Member

    Joined:
    Oct 17, 2004
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Hi everyone,
    I have a customer that for some reson his website cannot be displayed when using the www in front of his domainname. When he only uses http:// and no www, his website displays without a problem. Do you know what may be wrong? I checkd if the www redirection file was created and it was:

    lrwxrwxrwx 1 judits judits 11 Apr 6 20:20 www -> public_html/

    Thanks :)
     
  2. Voltio

    Voltio Active Member

    Joined:
    Oct 17, 2004
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    It's weird. It's working now. I didn't do anything.
     
  3. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    The existence of this link does not determine whether a site will load with www or not on a cPanel server.

    It is most probably DNS related. You could do a simple 'ping www.yoursite.com' from your computer next time to see if its DNS related or not. Glad it is working for you now.
     
  4. B12Org

    B12Org Well-Known Member

    Joined:
    Jul 15, 2003
    Messages:
    692
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle Washington
    cPanel Access Level:
    Root Administrator
    What does determine if the site will load with www or not on a cpanel server? (external to dns)
     
  5. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    ServerAlias settting in the VirtualHost of any site (in apache configuration file) contains www.domain.tld by default. This ensures www.domain.tld loads the same contents as domain.tld.
     
  6. B12Org

    B12Org Well-Known Member

    Joined:
    Jul 15, 2003
    Messages:
    692
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle Washington
    cPanel Access Level:
    Root Administrator
    is there a setting in cpanel that you can use to disable www or to enable it after domain creation - additionally is that setting present when creating a domain or is always assumed that both @none and www will be required and is thus setup ?
     
  7. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    No such setting

    There is no option for this in cPanel. By default, with no option to override, the virtual host in the httpd.conf file is defined as the domain name only, with a ServerAlias directive for www followed by the domain name.
     
  8. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    The www symlink in an account's home directory has nothing to do with whether a site is displayed depending on whether you use the www prefix or not. It is only provided as a link to the public_html directory, to make it more obvious to which directory one should upload the site's content. It is not in any way connected to the Apache definitions that do control access with or without "www" in the URL.

    It is not clear from the discussion in this thread exactly what caused your problem, which is now resolved, but there are at least a couple of possibilities:


    • An A record for www.domain.tld may not have been created in the domain's zone file. This would have caused www.domain.tld not to resolve to an IP address, while domain.tld did resolve to an IP address.
    • Some type of redirect may have been defined, most likely in the .htaccess file in the account's public_html directory, to redirect www.domain.tld to another location.
     
    #8 cPanelJared, Sep 2, 2010
    Last edited: Sep 2, 2010
  9. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Default account creation template in WHM does not contain an option to disable 'www'. However, you can simply change the www cname in the dns zone of the site to disable, or redirect www.domain.tld to some other location.
    Not many clients need www.domain.tld pointing to different location in my experience so adding this feature would not be that beneficial. If I had to disable this on a single server, I would just edit default DNS template and modify this line below to use www record per my need.

    www IN CNAME %domain%.

     
  10. B12Org

    B12Org Well-Known Member

    Joined:
    Jul 15, 2003
    Messages:
    692
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle Washington
    cPanel Access Level:
    Root Administrator
    Thanks - In Plesk for example you have check a box during domain creation to enable www for a domain (its not checked by default) so we get some customers that miss it and need us to enable it after the fact - something that is easy enough to do, so I was just wondering how cpanel did it.

    Thanks for clarifying for me :)
     
  11. jlshaw27

    jlshaw27 Registered

    Joined:
    Nov 17, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    To further this point, I just had this same problem and when I checked the ServerName line in the apache configuration file (httpd), the hostname had "www." in front of it. From what I am told this creates a conflict in cpanel and the hostname should never contain "www". I erased the "www." and right away my site started working both ways.
     
Loading...

Share This Page