Add-on domain causing duplicate content

Discussion in 'Search Engine Optimization' started by katexter, Aug 23, 2008.

  1. #1
    I have an add-on domain pointing to the main site. I can't do a 301 redirect because many companies block the main domain. Now, google is indexing both domains causing duplicate content.

    Can anyone help me fix this?
     
    katexter, Aug 23, 2008 IP
  2. pogung177

    pogung177 Well-Known Member

    Messages:
    415
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Just drop the other one domain, use htacess to redirect it
     
    pogung177, Aug 23, 2008 IP
  3. astup1didiot

    astup1didiot Notable Member

    Messages:
    5,926
    Likes Received:
    270
    Best Answers:
    0
    Trophy Points:
    280
    #3
    Just use the robots.txt file to block one of the sites entirely... simple fast solution for what you are looking for in your case. Just add the below code in a file called robots.txt in your root directory.

    
    User-agent: *
    Disallow: /
    
    Code (markup):
     
    astup1didiot, Aug 23, 2008 IP
  4. katexter

    katexter Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Because both domains point to the exact same content (intended result), I don't think a robots.txt to block just 1 without blocking the other.

    How do I use htaccess to redirect it, without making the domain name change to the blocked name?
     
    katexter, Aug 24, 2008 IP
  5. kulinar

    kulinar Member

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #5
    Then make a dynamic robots.txt. Open a PHP editor and create a php file that contains:
    <? if ($_SERVER['HTTP_HOST'] == 'www.thedomaintobedisallowed.com') {echo "User-agent: * \n Disallow: /";} else echo 'the content of the other robots.txt file'; ?>
    Code (markup):
    and upload the file in ROOT directory (where index file is).

    Then in your .htaccess file after

    Options +FollowSymlinks
    RewriteEngine On


    add this line
    RewriteRule ^robots.txt robots.php
    Code (markup):
    Hope that helps.
     
    kulinar, Aug 24, 2008 IP
  6. catanich

    catanich Peon

    Messages:
    1,921
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If your have two domain names going to the same IP address (web content), all SEs will bust you.
     
    catanich, Aug 24, 2008 IP
  7. lakelandprinting

    lakelandprinting Peon

    Messages:
    699
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I have 3 going to my site and never had a problem. Can't you still set a preferred domain in webmaster tools? That's what I did a while ago
     
    lakelandprinting, Aug 24, 2008 IP