I want to redirect non www URL to www URL - Anybody HELP me???

Discussion in 'Databases' started by doubler, Mar 22, 2008.

  1. #1
    i am trying to redirect my non www URL to www URL but no avail

    please help me again

    i want to redirect this http://domain.com
    to
    http://www.domain.com

    i am editing in .htaccess file with different codes but no avail

    like i used:


    and then

    __________________
     
    doubler, Mar 22, 2008 IP
  2. leader

    leader Peon

    Messages:
    481
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    leader, Mar 22, 2008 IP
  3. fabriciogr

    fabriciogr Active Member

    Messages:
    958
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    73
    #3
    this is the sort of thing i've done loads of times but have had to always google it.. so never completely sure and have to always test til i get it right.

    any how try putting the Rewrite Engine On at top:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
     
    fabriciogr, Mar 22, 2008 IP
  4. doubler

    doubler Active Member

    Messages:
    952
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    70
    #4
    i have 5 blogs with the same date base may be therefore i am getting this problem otherwise i tried to redirect one non www URL to www URL and succeed but now there are 5 blogs on the same date base, so any idea how can i redirect all...
     
    doubler, Mar 22, 2008 IP
  5. leader

    leader Peon

    Messages:
    481
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you have cPanel, you can redirect all your websites to one website.
     
    leader, Mar 22, 2008 IP
  6. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #6
    try the above code

    [edit] sorry i added wrong code first time round
     
    just-4-teens, Mar 22, 2008 IP
  7. ag3nt bi0s

    ag3nt bi0s Banned

    Messages:
    106
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    pal tell us do u have cpanel wid u or what cp are u using ?
     
    ag3nt bi0s, Mar 24, 2008 IP