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.

Need to make the root of a domain point to other htan www

Discussion in 'General Discussion' started by dmgens, Aug 30, 2011.

  1. dmgens

    dmgens Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Folks:

    I'm trying to point a domain abc..com to a root other than .home/abc/public_html How do I do this using cpanel.whm?

    Thanks in advance
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You can either do a redirect for the domain, use a rewrite rule in .htaccess, or if you have shell access for root to the machine, you could change the document root for the domain. Which access level do you have on the server?
     
  3. dmgens

    dmgens Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Both ssh and ehm
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If you want to change the document root for the domain, you can edit /var/cpanel/userdata/abc/abc.com file where abc is the cPanel username and abc.com is the domain name. In that file, change the lines as necessary:

    Code:
    documentroot: /home/abc/public_html
    homedir: /home/abc
    The documentroot path will determine what folder the domain uses for parsing the top-level of Apache requests for the site.

    After revising the file, then copy Apache configuration file, rebuild Apache and restart it:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110830
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    You may be cached to the old location, so check in a proxy after restarting Apache to ensure it is now showing the new location. A few good proxy places are proxify.net and kproxy.con

    Thanks!
     
  5. dmgens

    dmgens Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    This works if the url incluldes the inidex.php reference, but not if it is tearmredk9.com by itself now .

    I changed the
    documentroot: /home/r2ei/public_html/teamredk9.com

    do I needed to change homedir
    homedir: /home/r2ei to homedir: /home/r2ei/public_html ?
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    It works for me for both, mainly because I'm not cached. You appear to be cached, which I already indicated would probably be the case. Please check in a proxy to see that you are cached.

    You wouldn't change the homedir path when both are on the same username account.
     
  7. dmgens

    dmgens Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Thanks:

    Long day tired and forgot about cache, dumped it and works
     
Loading...

Share This Page