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.

change canonical name in whm/cpanel?

Discussion in 'General Discussion' started by cowboymike, Oct 27, 2012.

  1. cowboymike

    cowboymike Member

    Joined:
    Oct 27, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi,
    I am new user of whm and cpanel. My account was set up with mydomain.com as the canonical name for the domain. If I want change the canonical name from mydomain.com to www.mydomain.com? can you tell me how I might do that?

    I also want to redirect all traffic when users enter http://mydomain.com redirect to http://www.mydomain.com. Would I need to change the cname from mydomain.com to www.mydomain.com?


    Happy trails, Mike
     
    #1 cowboymike, Oct 27, 2012
    Last edited: Oct 27, 2012
  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
    Hello Mike,

    Can you please explain what is meant here? Both domain.com and www.domain.com should go to the same location. The domain must be domain.com in order for both to work.

    If you need the browser to always show www.domain.com, you'd simply add a redirect into the .htaccess such as the following:

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    Thanks!
     
  3. cowboymike

    cowboymike Member

    Joined:
    Oct 27, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thank you very much Tristan. You resolved my issue.
    Happy trails, Mike
     
Loading...

Share This Page