.htaccess 301 for alternate domains (non default) on the same server??

Discussion in 'Search Engine Optimization' started by projectv3, Mar 16, 2007.

  1. #1
    hey all

    just a quick questions, after learning a bit about htacces and sit duplication by google i was curious...

    what if i have more than one domain on the same server?

    how do i do 301redirect the extra domains which are organized in their own folder

    /domain2/

    RewriteCond %{HTTP_HOST} ^defaultdomain.com [NC]
    RewriteRule ^(.*)$ http://www.defaultdomain.com/$1 [L,R=301]

    works

    but

    RewriteCond %{HTTP_HOST} ^domain2.com [NC]
    RewriteRule ^(.*)$ http://www.domain2.com/$1 [L,R=301]

    doesnt work,

    i get an error along the lines of:
    cannot find xxx.domain2.com/domain2

    and the url is redirected to xxx.domain2.com/domain2 when i see this error

    (i had to change www to xxx cuz i'm new here so it wont let me post live urls)

    thanks in advance :)
     
    projectv3, Mar 16, 2007 IP
  2. projectv3

    projectv3 Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    :( anyone?
     
    projectv3, Mar 18, 2007 IP
  3. projectv3

    projectv3 Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    :( up again...
     
    projectv3, Mar 19, 2007 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    domain2.com/.htaccess is where it should go.
     
    Nintendo, Mar 19, 2007 IP