Problem in WWW Redirection

Discussion in 'Apache' started by alana13, Jan 29, 2009.

  1. #1
    Hi All,

    I did 301 redirection for my domain.com to www(dot)domain(dot)com by .htaccess file. But problem is it's not redirecting my domain in www, i checked coding of .htaccess file is correct and i put it in correct root in server. I want to know....

    What is the problem in this redirection?? can anybody suggest if he/she face this problem??

    What is the Apache Mode in hosting???

    I use this code in my .htaccess file


    I will be thankful to you all for your suggestion.

    Thanks & Regards,
    Alana
     
    alana13, Jan 29, 2009 IP
  2. The Rock

    The Rock Well-Known Member

    Messages:
    2,618
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    138
    #2
    I am also getting same problem. I will greatly appreciate if any one please give us better solution
     
    The Rock, Jan 30, 2009 IP
  3. kks_krishna

    kks_krishna Active Member

    Messages:
    1,495
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
  4. alek

    alek Banned

    Messages:
    846
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #4
    I think you all are talking about canonical problem, click on the link and get the solution.
     
    alek, Feb 6, 2009 IP
  5. darrenbeige

    darrenbeige Peon

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You didn't escape properly. Use:

    RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
    RewriteCond %{HTTP_HOST} !^$
    RewriteRule ^(.*) http://www.domain.com/$1 [L,R=301]
     
    darrenbeige, Feb 8, 2009 IP
  6. alana13

    alana13 Well-Known Member

    Messages:
    331
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #6
    Thanks for your replies friends!

    I use everything as u told me but it's not working yet. Can u give me any suggestion about this??

    Alana
     
    alana13, Feb 19, 2009 IP