1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Properly Redirect Site A To Site B

Discussion in 'Site & Server Administration' started by everypcneed, Apr 11, 2011.

  1. #1
    I have 2 domains, for example KeywordKeyword.com and keyword-keyword.com. I have keyword-keyword.com forwarded via my hosting account to KeywordKeyword.com.

    I have just noticed that Google is indexing both domains and the content that is on KeywordKeyword.com is also being indexed under the hyphenated domain.

    How do I properly ensure the following:

    1) Have the hyphenated domain redirect to KeywordKeyword.com properly. I am assuming something to do with the .htaccess file but I am not sure what?
    2) Ensure that the pages indexed in the SERPS for the hyphenated domain are 301'd to the KeywordKeyword.com domain so that domain is credited with the content rather then both?

    I am hoping someone can post the simple solution to get this done.
     
    everypcneed, Apr 11, 2011 IP
  2. Sepehr

    Sepehr Peon

    Messages:
    568
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If I were to do this I would park the second domain on the first. I'm not sure on how exactly this would effect things SEO-wise.

    Another solution might be to use php to redirect all URLs on 2nd domain to the 1st one with a 301.
     
    Sepehr, Apr 12, 2011 IP
  3. everypcneed

    everypcneed Peon

    Messages:
    238
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the response Sepehr

    Although my main concern is to resolve the SEO issues, which in this case is the duplicate indexing. I want the second domain to re-direct ALL traffic to the first domain. I understand using 301 redirects also flow page rank, etc.

    The only issue is I do not know how to complete the task. Suggestions?
     
    everypcneed, Apr 12, 2011 IP
  4. MartinPrestovic

    MartinPrestovic Peon

    Messages:
    213
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You will need to use modrewrite in your .htaccess file to achieve this.

    Sample code:

    
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(www\.)?keyword-keyword.com [NC]
    RewriteRule ^(.*)$ http://www.KeywordKeyword.com/$1 [L,R=301]
    
    Code (markup):
    What this does is says anything that comes in on either www.keyword-keyword.com or keyword-keyword.com will be redirected to www.KeywordKeyword.com

    Anything that is located after the trailing slash will be appended. So if someone came in on:

    keyword-keyword.com/i-love-google.html

    they would end up at:

    www.KeywordKeyword.com/i-love-google.html

    The header would be set as a 301 so all juice, etc would be passed from one page to the next.
     
    MartinPrestovic, Apr 13, 2011 IP
    everypcneed likes this.
  5. everypcneed

    everypcneed Peon

    Messages:
    238
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I thank you MartinPrestovic. This was exactly what I needed to sort out the issue.

    Now just need to wait for the SEs to update.
     
    everypcneed, Apr 14, 2011 IP