Addon Domain issue, http:// vs www. ?

Discussion in 'Programming' started by Kayz, Jan 13, 2009.

  1. #1
    Hi i have a Addon Domain and i noticed it only works when you enter the web address http://mydomain.co.uk however if i try www.mydomain.co.uk or http://www.mydomain.co.uk does not work.

    I have added a htaccess file and the following rewrite rule also but had no luck.


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


    Ive also tried

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^mydomain\.co.uk$ [NC]
    RewriteRule .* http://www.mydomain.co.uk/ [L,R=301]


    Any help would be appreciated.

    Cheers
     
    Kayz, Jan 13, 2009 IP
  2. oxidati0n

    oxidati0n Peon

    Messages:
    744
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Apache automatically syncs "www." with the normal HTTP root server, so you don't need to use handlers to sort a request which is already being handled.
     
    oxidati0n, Jan 15, 2009 IP
  3. Fracisc

    Fracisc Well-Known Member

    Messages:
    3,670
    Likes Received:
    10
    Best Answers:
    1
    Trophy Points:
    195
    #3
    Check your dns.
    You should have something like

    www 14400 IN CNAME mydomain.co.uk.

    If you don`t have it, just add it like in my ex.
     
    Fracisc, Jan 16, 2009 IP