How to point domainname.com to www.domainname.com

Discussion in 'Domain Names' started by clade, Mar 23, 2007.

  1. #1
    Hello everyone,

    I was just wondering, how do you point a domain name to www.domainname.com

    Like whenever someone entered yahoo.com, it goes to www.yahoo.com

    Thanks in advance.
     
    clade, Mar 23, 2007 IP
  2. MakeThatDollar

    MakeThatDollar Notable Member

    Messages:
    4,451
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    225
    #2
    Contact your hosting company and they can do that for you.
     
    MakeThatDollar, Mar 23, 2007 IP
  3. Monty

    Monty Peon

    Messages:
    1,363
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Write this in your .htaccess file

    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^domain.com [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
    Code (markup):
    Should work.
     
    Monty, Mar 23, 2007 IP
    Clive and clade like this.
  4. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #4
    Yep, and that's the best way of doing it afterall.
    No need to call the webhost.
     
    Clive, Mar 23, 2007 IP
  5. AlienGG

    AlienGG Banned

    Messages:
    983
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it only works when linux apache has the Mod-Rewrite module enabled.
     
    AlienGG, Mar 23, 2007 IP
  6. htmlindex

    htmlindex Prominent Member

    Messages:
    11,748
    Likes Received:
    284
    Best Answers:
    0
    Trophy Points:
    315
    #6
    Godaddy does this automatically so there's no need to do it, is that correct?
     
    htmlindex, Mar 23, 2007 IP
  7. AlienGG

    AlienGG Banned

    Messages:
    983
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #7
    correct, unless you change the default dns setting.
     
    AlienGG, Mar 23, 2007 IP
  8. topendtech

    topendtech Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Actually it should be done via your Domain Registrar under 'CNAMES'.

    If you have Godaddy I beleive 'www' is already a default.

    If you cant figure it out .. call your domain name provider and they will walk you through it.
     
    topendtech, Mar 23, 2007 IP
  9. njoker555

    njoker555 Notable Member

    Messages:
    4,392
    Likes Received:
    139
    Best Answers:
    0
    Trophy Points:
    240
    #9
    i wonder if moniker can set that for me now lol, htaccess modding wasnt working for me, this thread helped me a little too i guess lol :)
     
    njoker555, Mar 23, 2007 IP
  10. kenoornet

    kenoornet Peon

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Contact your hosting Company.
     
    kenoornet, Mar 24, 2007 IP
  11. clade

    clade Peon

    Messages:
    548
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Thanks for the help guys.
     
    clade, Mar 25, 2007 IP
  12. clade

    clade Peon

    Messages:
    548
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #12
    The .htaccess rewrite works! Thanks monty.
     
    clade, Mar 25, 2007 IP