301 Redirecting Whole SIte

Discussion in 'Site & Server Administration' started by crystak, Apr 13, 2009.

  1. #1
    How could I 301 redirect a domain to another? I just want when someone types in myoldsite.com for example to be redirected to mynewsite.com, I don't care about the other pages for now.

    I found this query on a website and I put it in the .htaccess of the old domain but it didn;t work:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://mynewsite.com/$1 [R=301,L]

    Any help? TIA!
     
    crystak, Apr 13, 2009 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Who is the domain registered with. You can usually to a 301 redirect from the registrar. I know that godaddy, register.com and probably most others support this.
     
    jestep, Apr 13, 2009 IP
  3. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #3
    Try following:

    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

    Kailash
     
    kailash, Apr 13, 2009 IP