My site won't work unless www. is typed, can you help?

Discussion in 'Apache' started by all4Christ, Jan 4, 2007.

  1. #1
    I can't figure out why the site won't come up without the www. typed, thank you all.
     
    all4Christ, Jan 4, 2007 IP
  2. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #2
    Add the following code into your .htaccess file:
    Options +FollowSymLinks 
    RewriteEngine on 
    RewriteCond %{HTTP_HOST} ^yoursite.com [NC] 
    RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L, R=301] 
    Code (markup):
     
    Richie_Ni, Jan 4, 2007 IP
  3. mixke

    mixke Prominent Member

    Messages:
    5,917
    Likes Received:
    590
    Best Answers:
    0
    Trophy Points:
    310
    #3
    mixke, Jan 4, 2007 IP
  4. Scorpiono

    Scorpiono Well-Known Member

    Messages:
    1,330
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    120
    #4
    Or just point your domain at the same IP as your www.
     
    Scorpiono, Jan 4, 2007 IP
  5. seoguruji

    seoguruji Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can check with your hosting company and ask them to change the host header to that both URLs i.e. with www and without www lead to the same URL. i.e when someone types in without the www, it will redirect to the site with the www.
     
    seoguruji, Jun 29, 2007 IP
  6. 24x7siteuptime

    24x7siteuptime Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Also check the "ServerAlias" option in your virtualhost entry..
     
    24x7siteuptime, Jun 30, 2007 IP