How to make mydomain.com go to http://www.mydomain.com instead of http://mydomain.com

Discussion in 'Site & Server Administration' started by Luckysacrifice, Mar 17, 2011.

  1. #1
    I really need to figure out how i can get my domain (http://www.glacialgaming.com) to redirect people to http://www.glacialgaming.com instead of http://glacialgaming.com when they type just "Glacialgaming.com" in there web browser.

    I am hosting my website on a VPS and i am using Name.com DNS record management to forward the domain to my virtual private servers IP (I'm using WAMP to host the site)

    Here is the records i have on Name.com

    A *.glacialgaming.com xxx.xxx.62.38 (delete) 300 2011-03-15 14:15:32
    A glacialgaming.com xxx.xxx.62.38 (delete) 300 2011-03-15 14:11:02
    A www.glacialgaming.com xxx.xxx.62.38 (delete) 300 2011-03-15 14:11:05

    I really need it so that if someone types glacialgaming.com in there browser to redirect them to http://www.glacialgaming.com instead of http://glacialgaming.com

    I hope someone can help me! Thanks
     
    Luckysacrifice, Mar 17, 2011 IP
  2. kaung

    kaung Twitter @KaungKo

    Messages:
    4,040
    Likes Received:
    187
    Best Answers:
    0
    Trophy Points:
    155
    #2
    Add this to your .htaccess
    or create .htaccess with this.

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^glacialgaming.com [nc]
    rewriterule ^(.*)$ http://www.glacialgaming.com/$1 [r=301,nc]
    Code (markup):
     
    kaung, Mar 17, 2011 IP
  3. Luckysacrifice

    Luckysacrifice Peon

    Messages:
    344
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I get an "Internal server error" if i create a new .htaccess with that text in it and place it in the WWW folder, I am using WAMP if that has anything to do with why it's giving me an internal server error..
     
    Luckysacrifice, Mar 17, 2011 IP
  4. kaung

    kaung Twitter @KaungKo

    Messages:
    4,040
    Likes Received:
    187
    Best Answers:
    0
    Trophy Points:
    155
    #4
    Did your log say "RewriteteEngine isn't a command"?
    If so seems like you don't have mod_rewrite installed and loaded.
     
    kaung, Mar 17, 2011 IP
  5. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #5
    Does a Windows server support .htaccess files? From what I recall, they did not, have not looked at a Windows server in years though.

    Chris
     
    RHS-Chris, Mar 17, 2011 IP
  6. shuman202

    shuman202 Well-Known Member

    Messages:
    638
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    145
    Digital Goods:
    1
    #6
    Very informative post. Thanks for taking the time to share your view with us.
     
    shuman202, Mar 18, 2011 IP
  7. Luckysacrifice

    Luckysacrifice Peon

    Messages:
    344
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I doubt they do support .htaccess files, and i don't know what log you are talking about, I am using WAMP and Name.com DNS forwarding to forward the domain to my VPS IP.
     
    Luckysacrifice, Mar 18, 2011 IP
  8. kaung

    kaung Twitter @KaungKo

    Messages:
    4,040
    Likes Received:
    187
    Best Answers:
    0
    Trophy Points:
    155
    #8
    It could be a matter of rewrite rule coding issue as well.
    One of the value might not be the right value to use for WAMP.

    I can't say for sure with WAMP now because I have experienced with Windows Server only twice long before.
    .htaccess seems to work after installation of additional modules on WAMP and renaming.
    However, I can't say for sure it'll work on your server or what modules you may need.

    Old topics I can find are:

    (need rewrite_module) http://www.icyphoenix.com/viewtopic.php?f=35&t=4935

    (htaccess and mod_rewrite in WAMP) http://www.phpmagicbook.com/allow-htaccess-and-mod-rewrite-in-wamp/

    (need auth_basic_module) http://terriswallow.com/weblog/2009/htaccess-password-protection-on-wamp-using-htpasswd/

    And something about tweaking a httpd config file > "AccessFileName .htaccess" to "AccessFileName htaccess.txt" and having htaccess.txt instead.
    Closet I can find is http://stackoverflow.com/questions/4321990/htaccess-not-working-on-window-wamp
     
    kaung, Mar 18, 2011 IP
  9. Luckysacrifice

    Luckysacrifice Peon

    Messages:
    344
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks for all the help, I'm going to check it out :)

    Nice to see someone helping out :)
     
    Luckysacrifice, Mar 18, 2011 IP