How to avoid double indexing

Discussion in 'General Marketing' started by martinvidic, Oct 30, 2007.

  1. #1
    Hi everbody
    I have 2 domains and my website can be accessed with both addresses and www & non-www versions.

    Now I only want www.domain2.com to be indexed by SE, because it has the best PR.

    So if I create a robot.txt file with following content, will that work?

    --------------------------------------------
    User-agent: WebCrawler
    Disallow: http://www.domain1.com/*.*
    Disallow: http://domain1.com/*.*
    Disallow: http://domain2.com/*.*
    --------------------------------------------

    I tried redirets and mod rewrited before, but I don't really care if people can access the site differently... ( only care about SE indexing )

    Hope somebody can help me with this

    Reards
    2 everybody
    MAVI
     
    martinvidic, Oct 30, 2007 IP
  2. Matt B

    Matt B Active Member

    Messages:
    1,350
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    90
    #2
    Use .htaccess.
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^yourdomain\.com
    RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=permanent,L]
    Code (markup):
    - Matt
     
    Matt B, Oct 30, 2007 IP